Using an upstream header value as a proxy_cache_key

Troy Hakala troy.hakala at gmail.com
Fri Dec 25 02:50:37 MSK 2009


Duh! That makes sense. :-) Thanks.


On Dec 24, 2009, at 3:34 PM, Maxim Dounin <mdounin at mdounin.ru> wrote:

> Hello!
>
> On Thu, Dec 24, 2009 at 03:28:25PM -0800, Troy Hakala wrote:
>
>> Is it possible to have an upstream server set an HTTP header
>> that can be used as the key in proxy_cache_key? This doesn't
>> work:
>>
>>                proxy_cache_key $upstream_http_x_myheader;
>>
>> And neither does this:
>>
>>                set $v $upstream_http_x_myheader;
>>                proxy_cache_key $v;
>
> It won't, as $upstream_* variables are available only after
> request to upstream while cache key must be constructable from
> client request (before request to upstream, to find out if it's
> needed).
>
> Maxim Dounin
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list