How to send proxy cache status to backend server?

Makailol Charls makailol7 at
Sat Mar 15 07:44:51 UTC 2014


I have been using add_header to send cache status to downstream server or
client like this. This is working fine.
add_header Cache-Status $upstream_cache_status;

Now I tried proxy_set_header to send header to upstream as below.
proxy_set_header Cache-Status $upstream_cache_status;

But this could not send headers to upstream backend server. I think we can
not use "$upstream_*"  variables to send headers to upstream backend.

Would you suggest me some way to send cache-status to backend upstream


On Fri, Mar 14, 2014 at 9:11 PM, Maxim Dounin <mdounin at> wrote:

> Hello!
> On Fri, Mar 14, 2014 at 07:35:52PM +0530, Makailol Charls wrote:
> > Hello,
> >
> > I have been using proxy cache of Nginx. It provides response header to
> > indicate cache status. Is there some way to forward the cache status (in
> > case of miss, expired or revalidate ) to backend upstream server?
> The proxy_set_header directive should work, see
> --
> Maxim Dounin
> _______________________________________________
> nginx mailing list
> nginx at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list