Welcome! Log In Create A New Profile

Advanced

Re: Nginx case insensitive URL and rewrite URL?

Francis Daly
December 17, 2014 12:02PM
On Wed, Dec 17, 2014 at 09:15:54AM -0500, grydan wrote:

Hi there,

> I need that the URL request from any combination of FOLDER1 (case
> insensitive) is rewrite from URL
>
> http://www.pippo.com/FOLDER1/etc..etc..etc..
> to (always lowercase folder1)
>
> http://12.0.0.1/folder1/etc..etc..etc...
> where etc..etc..etc. = anything that I need to keep

Use a location{} that matches these requests, and give proxy_pass the
full uri.

Something like

location ~* ^/folder1/(.*) {
proxy_pass http://127.0.0.1:8080/folder1/$1$is_args$args;
}

although you probably want more directives in there too.

Note that, while this does work in a test system, it might be contrary
to the documentation at http://nginx.org/r/proxy_pass, so it may not
work forever. I think that the fact that the regex matches the complete
request uri probably means that it is ok, though.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Nginx case insensitive URL and rewrite URL?

grydan December 17, 2014 09:15AM

Re: Nginx case insensitive URL and rewrite URL?

itpp2012 December 17, 2014 10:03AM

Re: Nginx case insensitive URL and rewrite URL?

grydan December 17, 2014 10:23AM

Re: Nginx case insensitive URL and rewrite URL?

itpp2012 December 17, 2014 10:37AM

Re: Nginx case insensitive URL and rewrite URL?

grydan December 17, 2014 10:47AM

Re: Nginx case insensitive URL and rewrite URL?

Francis Daly December 17, 2014 12:02PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 297
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