diff --git a/nginx.conf b/nginx.conf index 8b54e2d..537e422 100644 --- a/nginx.conf +++ b/nginx.conf @@ -13,6 +13,11 @@ http { server { listen 80; + # Automatically redirect URLs missing trailing slash (but not files like .js, .css, etc.) + if ($request_uri ~ ^([^.\?\#]*[^/])$) { + return 301 $request_uri/; + } + location / { proxy_pass http://main-website:3000; proxy_set_header Host $host;