2016-09-01 17 views
0

我需要在某些情況下禁用gzip,而不管客戶端的Accept-*請求標頭。在Nginx上執行沒有Gzip

我的Nginx的conf條目下列指令:

gzip off; 

more_clear_input_headers -t 'text/html' Accept Accept-Encoding; 

proxy_set_header Accept ""; 
proxy_set_header Accept-Encoding ""; 

但是,下面捲曲:

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 

結果與:

< 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 

注意,響應的服務器代理通過這個Nginx。

+0

請包括conf。 –

回答