I'm trying to redirect traffic to our new server but the old server (Mac OS) used case insensitive file names while the new (embedded) one uses Linux (case sensitive). My problem is to redirect traffic from:
http://server.com/NEW/variable_url
to
http://server.com/new/variable_url
(note the lower 'new').
I would like to be able to do this for nginx without using perl or lua or other modules as this server is running in an embedded environment.
So far I tried:
location ~* ^/new/ {
access_log /var/log/nginx/new.log combined;
rewrite ^/new/(.*)$ $1 permanent;
}
without success.
Solved it myself. I was missing the root directive which points to the root of the web server. So for anyone interested the solution is:
location ~* ^/NEW/ {
root /etc/nginx/html/;
rewrite /NEW/(.*)$ /new/$1 permanent;
}