Welcome! Log In Create A New Profile

Advanced

Re: regex

Tobia Conforto
February 20, 2010 11:36AM
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
_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

regex

budala10 February 18, 2010 04:04PM

Re: regex

Tobia Conforto February 20, 2010 11:36AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 299
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready