Disable gzip on HEAD requests in v2 endpoints

nginx's gzip module will ignore the content-length header on the HEAD request and try to gzip the body.... but there is no body, so it simply writes no header at all.

Code to turn this off was based off of https://trac.nginx.org/nginx/ticket/261
This commit is contained in:
Joseph Schorr 2017-05-03 18:27:45 -04:00
parent 105acbc041
commit bf51ec20e8

View file

@ -105,6 +105,10 @@ location ~ ^/v2 {
return 404; return 404;
} }
if ($request_method = HEAD ) {
gzip off;
}
# Setting ANY header clears all inherited proxy_set_header directives # Setting ANY header clears all inherited proxy_set_header directives
proxy_set_header X-Forwarded-For $proper_forwarded_for; proxy_set_header X-Forwarded-For $proper_forwarded_for;
proxy_set_header X-Forwarded-Proto $proper_scheme; proxy_set_header X-Forwarded-Proto $proper_scheme;