How to send proxy cache status to backend server?
makailol7 at gmail.com
Thu Mar 27 09:31:22 UTC 2014
Apart from passing cache status to backend, would it be possible to send
some other headers which are stored in cache?
For example, If backed sets header "Foo : Bar" , which is stored in cache.
Now when cache is expired , request will be sent to backend. At that time
can we send the value of Foo header stored in cache to upstream backend?
I tried to achieve this with below code but it could not work.
proxy_set_header Foo $upstream_http_Foo;
Would you suggest me how to achieve this or what am I doing wrong here.
On Thu, Mar 20, 2014 at 6:56 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:
> On Thu, Mar 20, 2014 at 09:38:40AM +0530, Makailol Charls wrote:
> > Hi,
> > Is there some way to achieve this? I want to pass requests to backend
> > on cache status condition.
> This is not something easily possible, as cache status is only
> known after we started processing proxy_pass and already know
> which backend will be used. (Note that by default proxy_cache_key
> uses $proxy_host, which wouldn't be known otherwise.)
> If you want to check BYPASS as in your previous message, I would
> recommend checking relevant conditions from proxy_cache_bypass
> separately. As a more generic though less effective aproach, an
> additional proxy layer may be used.
> Maxim Dounin
> nginx mailing list
> nginx at nginx.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the nginx