Rewriting a location in Nginx
October 6th, 2009
No comments
For some reason I had a tough time finding this one, so for my own future use and in case it helps anyone else, here’s how you rewrite a url inside an nginx config file.
Calling the old url OldUrl and the url to map to newUrl, here it is:
server {
listen 80;
server_name siteName;
... (other configuration)
location oldUrl
{
rewrite oldUrl
newUrl permanent;
}
}
Not that hard, but hard to find

Leave a Reply