Help: cache or not by cookie

ned0r nginx-forum at
Fri Sep 4 02:53:41 MSD 2009

If you use the proxy_cache_key directive as you demonstrated above (i.e. proxy_cache_key "http://cacheserver$request_uri$cookie_user";) then my understanding is:

If a user doesn't have that cookie set, the page will be cached, and all users who don't have the cookie set will see the same page.

If a user does have that cookie set, then the page will also be cached, but it will only be served to people who have identical values for that cookie (in my case this means users with that session key).

Is this correct?

The problem is that that isn't how it appears to be working at the moment. I've put the $cookie_sessionkey variable in my proxy_cache_key and I'm basically seeing the "logged in page" for both browsers with and without the cookie set :-(

I'm using nginx 0.7.61 (from Debian Sid)



Posted at Nginx Forum:,3173,5599#msg-5599

More information about the nginx mailing list