Nginx case insensitive URL and rewrite URL?

Francis Daly francis at
Wed Dec 17 17:00:32 UTC 2014

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
> to (always lowercase folder1)
> 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/(.*) {

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, 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.

Francis Daly        francis at

More information about the nginx mailing list