Welcome! Log In Create A New Profile

Advanced

Nginx Caching Error Response Code like 400 , 500 , 503 ,etc

Posted by anish10dec 
Nginx Caching Error Response Code like 400 , 500 , 503 ,etc
August 06, 2016 04:13AM
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.

Regards,
Anish
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 309
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready