From bb92bd080d8e383948f350b1fd89cb7d0c53e408 Mon Sep 17 00:00:00 2001 From: Alan Orth Date: Mon, 9 Mar 2015 10:19:34 +0300 Subject: [PATCH] roles/nginx: Add $request_method to nginx fastcgi_cache_key nginx is caching HEAD requests, then when users come along and do a GET request they get an HTTP 200 with no request body. It seems setting fastcgi_request_methods to GET doesn't stop nginx from caching HEADs, so for now just add the $request_method to the key. Signed-off-by: Alan Orth --- roles/nginx/files/fastcgi_cache | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/nginx/files/fastcgi_cache b/roles/nginx/files/fastcgi_cache index a6b352b..b930fa8 100644 --- a/roles/nginx/files/fastcgi_cache +++ b/roles/nginx/files/fastcgi_cache @@ -1,4 +1,4 @@ -fastcgi_cache_key $scheme$host$request_uri; +fastcgi_cache_key $scheme$host$request_method$request_uri; # According to the docs, a 1m key zone can store ~8,000 keys, so 10m should # be enough. See: http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html fastcgi_cache_path /var/cache/nginx/cached/fastcgi levels=2:2 keys_zone=global:10m inactive=60m max_size=1G;