I try to get an \"/\" to every urls end:
example.com/art
should
example.com/art/
I use nginx as webserver.
I need the rewrite rule f
If nginx behind proxy with https, this snippet do correct redirect for $scheme
map $http_x_forwarded_proto $upstream_scheme {
"https" "https";
default "http";
}
server {
...
location / {
rewrite ^([^.\?]*[^/])$ $upstream_scheme://$http_host$1/ permanent;
}
...
}
And on the upstream proxy pass the X-Forwarded-Proto
header like:
location / {
proxy_set_header X-Forwarded-Proto $scheme;
...
}