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. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,233778,233783#msg-233783