From 3c8514695ea0f85c39edb3517b4332bf86c0eb39 Mon Sep 17 00:00:00 2001 From: Trammell Hudson Date: Tue, 17 May 2022 19:06:25 +0000 Subject: [PATCH] nginx: rewrite hedgedoc /s links on top level site --- nginx/nginx/templates/000-default.conf.template | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nginx/nginx/templates/000-default.conf.template b/nginx/nginx/templates/000-default.conf.template index ac070b9..293d02c 100644 --- a/nginx/nginx/templates/000-default.conf.template +++ b/nginx/nginx/templates/000-default.conf.template @@ -53,6 +53,10 @@ server { location = / { return 302 https://${DOMAIN_NAME}/Main_Page; } + # rewrite /s/ links to the bare link + location ~ ^/s/(.*) { + return 302 https://${DOMAIN_NAME}/$1; + } # normal pages go to hedgedoc static site (need to define ports in the env) # need to rewrite the CSP so that it allows reframing from the main site location / {