regex

Tobia Conforto tobia.conforto at gmail.com
Fri Feb 19 00:41:03 MSK 2010


budala10 wrote:
> Hi, if i have a url ending with a / how can i rewrite the request before go to the proxy so the ending slash is dropped?

rewrite ^(.*)/$ $1;

This is because in nginx you cannot substitute part of the url. The replacement string is always considered as a whole new url. So this will not work:

rewrite /$ "";  # DOESN'T WORK


Tobia


More information about the nginx mailing list