# Proxy\_cache 404 doesn't add headers

**URL:** <https://www.ruby-forum.com/t/proxy-cache-404-doesnt-add-headers/207125>\
**Category:** NGINX\
**Created:** [May 18, 2011, 10:21pm UTC](https://www.ruby-forum.com/t/proxy-cache-404-doesnt-add-headers/207125 "2011-05-18T22:21:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [May 18, 2011, 10:21pm UTC](https://www.ruby-forum.com/t/proxy-cache-404-doesnt-add-headers/207125/1 "2011-05-18T22:21:21Z")

</div>

Hi.

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  
“$upstream\_cache\_status,$upstream\_status,$upstream\_addr”;

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  
added.

Any insight onto this behavior would be great.

Thank you,  
Matt Mankins

Posted at Nginx Forum:

> **[proxy\_cache 404 doesn't add headers](https://forum.nginx.org/read.php?2,199145,199145#msg-199145)**
>
> Hi. 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...
