Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using nginx to rewrite a url

rewrite ^/old$ /new1 permanent;

I need to change the address that /old redirects to (/new1) every few days. I noticed that when I change the /new1 url to /new2 and restart nginx, browser still redirects to /new1 untill I clear browser cache.

How can I prevent browser from cacheing redirection url?

P.S. The reason I need to keep changing the url is that I have a banner set up on one of the sites and in order to not bother the site owner with new url all the time, I though I'd give him one address to use and keep changing my redirection myself.

share|improve this question
up vote 5 down vote accepted

You should not use permanent redirections. The code should be:

rewrite ^/old$ /new1 redirect;
share|improve this answer
That worked. Thank you. – user80666 Jun 25 '12 at 17:28

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.