corrupted cache file: proxy_cache_valid ignored

Roger Fischer roger at netskrt.io
Tue Feb 8 07:39:08 UTC 2022


Hello, 

we have observed a case where it seems that the proxy_cache_valid directive is ignored.

nginx version: 1.19.9

Config: proxy_cache_valid 200 206 30d;

Scenario:
* A cache file was corrupted (a file system issue). A part of the section that contains the headers had been overwritten with binary data.
* The resource represented by the corrupted cache file is requested.
* NGINX detects the corrupted cache file, and proxies the request upstream.
* The request is rejected by the upstream, with the upstream returning a 403 status.
* The 403 is returned to the client.
This is all good, but
* The request is repeated, and a cached 403 is returned, despite only caching 200 and 206.
* Upon examination, the cache file contains the 403 response from upstream.

Has anyone else seen something like this? Could this possibly be a bug?

Unfortunately I am not in a position to try to reproduce this at this time.

Thanks…

Roger




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20220207/62219389/attachment.htm>


More information about the nginx mailing list