proxy_cache 404 doesn't add headers

mankins nginx-forum at
Thu May 19 00:20:31 MSD 2011


In nginx 1.0.2 on Fedora, I'm using the proxy_cache in conjunction with
add_header to add the following header with cache-status (MISS,EXPIRED,
etc.) after the cache check:

add_header   X-Cache

This works as expected for http status codes 200, 301, 302, but fails to
work for 404.

I've verified that the cache is actually working for 404 requests
(upstream sees no requests), but the extra add_header fails to get

Any insight onto this behavior would be great. 

Thank you,
Matt Mankins

Posted at Nginx Forum:,199145,199145#msg-199145

More information about the nginx mailing list