Caching for a location based on cookie

agentzh agentzh at
Fri Jan 15 12:07:46 MSK 2010

On Fri, Jan 15, 2010 at 4:06 PM, Vinay Y S <vinay.ys at> wrote:
> Hi,
> For a given location, I want the requests to be cached only if a particular cookie is not present. How do I achieve that with nginx?
> Currently I'm trying following config
>     location /album {
>         if ($cookie_logintoken ~* "") {
>             set $cache_key $scheme$proxy_host$uri$is_args$args;
>         }

Please see this thread for a simple solution:,25197

Hope this helps.


More information about the nginx mailing list