From ba7d00c78867402c9b3339d60bbf5c9632d90cdf Mon Sep 17 00:00:00 2001 From: Thatsaphorn Atchariyaphap Date: Mon, 9 Jun 2025 09:29:22 +0200 Subject: [PATCH] Disable trailing slash redirect logic and add rewrite rule for law firm demo 1 path in nginx config --- nginx.conf | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/nginx.conf b/nginx.conf index 537e422..a0e1628 100644 --- a/nginx.conf +++ b/nginx.conf @@ -14,9 +14,9 @@ http { listen 80; # Automatically redirect URLs missing trailing slash (but not files like .js, .css, etc.) - if ($request_uri ~ ^([^.\?\#]*[^/])$) { - return 301 $request_uri/; - } + #if ($request_uri ~ ^([^.\?\#]*[^/])$) { + # return 301 $request_uri/; + # } location / { proxy_pass http://main-website:3000; @@ -28,6 +28,9 @@ http { location /lawfirm/demo1/ { proxy_pass http://ld1:3000/; + + rewrite ^/lawfirm/demo1(/.*)$ $1 break; + proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;