From 4c48af8d3cb979c4e937e04fc02cb4b71c1e60eb Mon Sep 17 00:00:00 2001 From: linearcombination <4829djaskdfj@gmail.com> Date: Tue, 18 Jun 2024 14:18:31 -0700 Subject: [PATCH] Fix nginx trailing slash issue (with redirect) Stop using try_files as it causes a redirect by design. See https://stackoverflow.com/questions/53454974/how-to-get-url-parameter-and-pass-to-proxy-pass-using-nginx --- frontend/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/nginx.conf b/frontend/nginx.conf index 23638cca..8884458c 100644 --- a/frontend/nginx.conf +++ b/frontend/nginx.conf @@ -9,7 +9,7 @@ server { root /app/build/client; location / { - try_files $uri $uri/ @sveltekit; + $uri $uri/ @sveltekit; } location @sveltekit { @@ -20,7 +20,7 @@ server { proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Sendfile-Type X-Accel-Redirect; - proxy_pass http://sveltekit-server/; + proxy_pass http://sveltekit-server; proxy_redirect off; error_page 502 = @static;