Add trailing slash redirect rule in nginx.conf to standardize URLs

This commit is contained in:
2025-06-08 21:57:52 +02:00
parent e61b88c9d9
commit 2b77f6499b

View File

@@ -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;