NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
Livid
288.98D
531.47D
V2EX  ›  NGINX

关于如何强制让 Nginx 不返回 GZIP 压缩过的内容

  •  
  •   Livid ·
    PRO
    · Apr 29, 2014 · 5659 views
    This topic created in 4429 days ago, the information mentioned may be changed or developed.
    貌似正确的做法就是在 request header 里加上 Accept-Encoding: identity 么?
    6 replies    2014-05-01 10:38:35 +08:00
    Jreen
        1
    Jreen  
       Apr 29, 2014
    Accept-Encoding:
    本来就是默认identity的。然后你最好对response的Content-Encoding监测。
    Livid
        2
    Livid  
    MOD
    OP
    PRO
       Apr 29, 2014
    @Jreen 刚才经过试验,可以确认 Nginx 会忽略 Accept-Encoding: identity,如果缓存里已经有一个 gzip 且 HIT 了的内容的话。
    alvin2ye
        3
    alvin2ye  
       Apr 29, 2014
    用个别的扩展名不就行了。
    julyclyde
        4
    julyclyde  
       Apr 30, 2014
    这是要对付什么奇怪的客户端?
    Livid
        5
    Livid  
    MOD
    OP
    PRO
       Apr 30, 2014
    @julyclyde Pingdom 的探测不支持 gzip。但是如果缓存里已经有 gzip,NGINX 就会在任何情况下都只返回 gzip 的内容。
    julyclyde
        6
    julyclyde  
       May 1, 2014
    唉,都什么年代了……
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1321 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 17:00 · PVG 01:00 · LAX 10:00 · JFK 13:00
    ♥ Do have faith in what you're doing.