<div dir="ltr"><div><div><div><div><div><div>Hi Maxim,<br><br></div>Apart from passing cache status to backend, would it be possible to send some other headers which are stored in cache?<br><br></div>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?<br>
<br></div>I tried to achieve this with below code but it could not work.<br>proxy_set_header Foo $upstream_http_Foo;<br><br></div>Would you suggest me how to achieve this or what am I doing wrong here.<br><br></div>Thanks,<br>
</div>Makailol<br><div><div><div><br><br></div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Mar 20, 2014 at 6:56 PM, Maxim Dounin <span dir="ltr"><<a href="mailto:mdounin@mdounin.ru" target="_blank">mdounin@mdounin.ru</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello!<br>
<div class=""><br>
On Thu, Mar 20, 2014 at 09:38:40AM +0530, Makailol Charls wrote:<br>
<br>
> Hi,<br>
><br>
> Is there some way to achieve this? I want to pass requests to backend based<br>
> on cache status condition.<br>
<br>
</div>This is not something easily possible, as cache status is only<br>
known after we started processing proxy_pass and already know<br>
which backend will be used. (Note that by default proxy_cache_key<br>
uses $proxy_host, which wouldn't be known otherwise.)<br>
<br>
If you want to check BYPASS as in your previous message, I would<br>
recommend checking relevant conditions from proxy_cache_bypass<br>
separately. As a more generic though less effective aproach, an<br>
additional proxy layer may be used.<br>
<div class="HOEnZb"><div class="h5"><br>
--<br>
Maxim Dounin<br>
<a href="http://nginx.org/" target="_blank">http://nginx.org/</a><br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</div></div></blockquote></div><br></div>