Trailing Slash Redirect Loop Help

Alex Med nginx-forum at forum.nginx.org
Fri Apr 28 14:48:19 UTC 2017


Steveh:

Thank you for your reply.

So what you are suggesting me to do is something like this:

location / {
    try_files $uri $uri/ @rewrite;
}

location @rewrite {
     rewrite ^/(.*)/$ /$1 permanent;
}

Put try files inside the location block and create a new block with the
rewrite?

Thank you for the clarification!

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,273964,273966#msg-273966



More information about the nginx mailing list