Multiple upstream_cache_status headers in response in a dual-cache configuration

Reinis Rozitis r at
Fri Oct 6 11:39:03 UTC 2017

> Why am I getting the header twice for the 6th request. In this case, the
> request is HIT by the SSD cache itself, and there is no request sent to local
> upstream also.
> So, shouldn't I be getting only one instance of the header in the response?

Nginx saves the object with all the headers from origin.

Since your "ssd cache" makes a request to "mylocalhdd" which returns the object with the X-UpStream-Server-Cache-Status then nginx returns the original object + adds an extra header (coming from the "ssd cache" server block).

To hide second header you probably need to use proxy_hide_header in the "ssd cache" block .


More information about the nginx mailing list