Nginx case insensitive URL and rewrite URL?

I have Nginx configured as reverse proxy

server {
listen 80;
server_name www.pluto.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8080;
}
}
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

How can I do?

Posted at Nginx Forum:

would be the easiest solution.

Posted at Nginx Forum:

How can I use this module?
I’m a newbie of NGINX

tnx

Posted at Nginx Forum:

grydan Wrote:

ok, but after that how can I use in my scenario this?

Posted at Nginx Forum:

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 Module ngx_http_proxy_module, 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 D. [email protected]