我的环境是 nginx(1.3.11) + php-fpm
curl -I -H "Accept-Encoding: gzip,deflate" http://www.ihezhu.com/
结果是
HTTP/1.1 200 OK
Server: nginx
Date: Wed, 03 Jul 2013 07:47:27 GMT
Content-Type: text/html; charset=utf-8
Connection: keep-alive
Vary: Accept-Encoding
Set-Cookie: PHPSESSID=st7oa6mero58n6lmitlofa4n70; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Encoding: gzip
但是当我使用像chrome这样的浏览器并且响应不包含gzip
时[有一个特殊情况:打开http://www.ihezhu.com/list/md_area-c_beijing/f_2000.3000_0_0_0_0_0_0_0.0.0.0.0_0_0-s_time_asc- lt_list-p_1/ , 响应 gzip T_T]
怎么了?
我的 nginx 设置是
gzip on;
gzip_buffers 4 16k;
gzip_comp_level 3;
gzip_http_version 1.1;
gzip_min_length 1k;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_vary on;
gzip_disable msie6;
谢谢
我的 nginx 编译选项,nginx virson 现在更新到 1.5.2
./configure \
--pid-path=/var/run/nginx.pid \
--lock-path=/var/lock/nginx.lock \
--user=nginx \
--group=nginx \
--with-http_realip_module \
--with-http_gzip_static_module \
--with-http_stub_status_module \
--with-pcre=/var/src/pcre-8.33 \
--with-zlib=/var/src/zlib-1.2.8 \
--http-client-body-temp-path=/var/tmp/nginx/client \
--http-proxy-temp-path=/var/tmp/nginx/proxy \
--http-fastcgi-temp-path=/var/tmp/nginx/fastcgi \
--http-uwsgi-temp-path=/var/tmp/nginx/uwsgi \
--http-scgi-temp-path=/var/tmp/nginx/scgi
更新信息
url http://www.ihezhu.com/list和http://www.ihezhu.com/list/md_area-c_shanghai/f_0.0_0_0_0_0_0_0_0.0.0.0.0_0_0-s_time_asc-lt_list-p_1/响应内容相同,但只有长的有gzip ..