Prevent caching of 301 redirects

petestorey nginx-forum at nginx.us
Thu Apr 16 11:04:55 UTC 2015


Hi

I'm running nginx as a reverse proxy for a website, and we have an
occasional problem where one of the back end servers occasionally sends an
errant 301 with caching headers as the home page for the site.  nginx then
caches this and responds to any requests with this redirect to the wrong
place.

I've rtfm and clearly need to use proxy_no_cache and proxy_cache_bypass, but
I'm none the wiser on how to actually format it for this, or indeed whether
it's possible to control based on the http response code?

thanks
Pete

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,258089,258089#msg-258089



More information about the nginx mailing list