Eu preciso desativar o gzip em alguns casos, independentemente dos cabeçalhos de solicitação Accept-*
do cliente.
A entrada conf do meu Nginx tem as seguintes diretivas:
gzip off;
more_clear_input_headers -t 'text/html' Accept Accept-Encoding;
proxy_set_header Accept "";
proxy_set_header Accept-Encoding "";
No entanto, o seguinte enrolar:
curl '$URL'
-H 'Pragma: no-cache'
-H 'Accept-Encoding: gzip, deflate, sdch'
-H 'Accept-Language: en-US,en;q=0.8,he;q=0.6'
-H 'Upgrade-Insecure-Requests: 1'
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36'
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
-H 'Cache-Control: no-cache'
-H 'Cookie: "$COOKIE"'
-H 'Connection: keep-alive' -v > /dev/null
Resultados com:
< HTTP/1.1 200 OK
< Cache-Control: no-cache, no-store, private
< Content-Encoding: gzip
< Content-Type: text/html;charset=utf-8
< Date: Thu, 01 Sep 2016 07:13:30 GMT
< Expires: -1
< Server: Reblaze Secure Web Gateway
< Set-Cookie: ...
< Set-Cookie: ...
< Set-Cookie: ...
< Set-Cookie: ...
< Set-Cookie: ...
< Set-Cookie: ...
< Set-Cookie: ...
< Vary: User-Agent
< Content-Length: 55455
< Connection: keep-alive
Observe que o servidor de resposta é intermediado por proxy por este Nginx.