Thanks a lot proxy_buffers 8 2m; proxy_buffer_size 10m; proxy_busy_buffers_size 10m; Now the response gets cached properly. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,234567,234967#msg-234967