Maxim Dounin
February 08, 2022 08:34AM
Hello!

On Mon, Feb 07, 2022 at 11:39:08PM -0800, Roger Fischer wrote:

> 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?

As long as you don't have corresponding proxy_ignore_headers in
your configuration, cache validity can be also set by the response
itself: via Cache-Control, Expires, and X-Accel-Expires headers.
Check the response headers in the cache file to see if there are
any of these.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

corrupted cache file: proxy_cache_valid ignored

roger_bc February 08, 2022 02:44AM

Re: corrupted cache file: proxy_cache_valid ignored

Maxim Dounin February 08, 2022 08:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 278
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