Disable trailing slash redirect logic and add rewrite rule for law firm demo 1 path in nginx config

This commit is contained in:
2025-06-09 09:29:22 +02:00
parent 42db88b3ca
commit ba7d00c788

View File

@@ -14,9 +14,9 @@ http {
listen 80; listen 80;
# Automatically redirect URLs missing trailing slash (but not files like .js, .css, etc.) # Automatically redirect URLs missing trailing slash (but not files like .js, .css, etc.)
if ($request_uri ~ ^([^.\?\#]*[^/])$) { #if ($request_uri ~ ^([^.\?\#]*[^/])$) {
return 301 $request_uri/; # return 301 $request_uri/;
} # }
location / { location / {
proxy_pass http://main-website:3000; proxy_pass http://main-website:3000;
@@ -28,6 +28,9 @@ http {
location /lawfirm/demo1/ { location /lawfirm/demo1/ {
proxy_pass http://ld1:3000/; proxy_pass http://ld1:3000/;
rewrite ^/lawfirm/demo1(/.*)$ $1 break;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;