Nginx Caching Error Response Code like 400 , 500 , 503 ,etc
wandenberg at gmail.com
Sun Aug 7 13:19:30 UTC 2016
Check if your backend server is setting cache headers on errors like
Cache-Control / Expires.
Nginx by default uses these headers to know if the response should be
cached or not.
When these headers are not present it uses the configuration done with
On Sun, Aug 7, 2016 at 9:43 AM, anish10dec <nginx-forum at forum.nginx.org>
> Hi Everyone,
> We are using Nginx as Caching Server .
> As per Nginx Documentation by default nginx caches 200, 301 & 302 response
> code but we are observing that if Upstream server gives error 400 or 500 or
> 503, etc , response is getting cached and all other requests for same file
> becomes HIT.
> Though if we set proxy_cache_valid specifying response code ( like
> proxy_cache_valid 200 15m; ) then also its caching the error response code
> but its not caching 301 & 302 in that case. Why the same is not getting
> applied for error response code.
> Is this the behaviour of Nginx or bug in Nginx ? We are using 1.4.0 version
> of Nginx
> Please help so that error response codes should not get cached as this is
> giving the same error response to users who are requesting for the file
> though upstream server is healthy and ok to serve the request.
> Posted at Nginx Forum: https://forum.nginx.org/read.
> nginx mailing list
> nginx at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx