proxy_cache_bypass and proxy_no_cache

Antonio P.P. Almeida appa at perusio.net
Mon Dec 10 09:27:14 UTC 2012


> I did this ( my cookie name is cahe )
>
>     map $cookie_cache $dont_cache {
>         0 1;
>         1 0;
>     }
>
> proxy_cache_bypass    $dont_cache;
> proxy_no_cache        $dont_cache;
>
> But the first request which does not have the cookie is getting cached.

Try:

map $cookie_cache $dont_cache {
   default 1;
   ~.+$  0;
}

--appa



More information about the nginx mailing list