春哥!
我在nginx中配置 gzip, 配置如下
location /test/ {
gzip on;
gzip_min_length 1k;
gzip_buffers 4 16k;
gzip_http_version 1.1;
gzip_comp_level 2;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/x-javascript text/css application/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png;
gzip_vary off;
root /data;
autoindex on;
}
而且已经验证过 nginx的模块中包含--with-http_gzip_static_module,, 是使用./configure --with-http_gzip_static_module 的方式配置,然后make , make install
仍旧显示非压缩模式!返回结果如下!
HTTP/1.1 200 OK
Date: Tue, 02 Sep 2014 14:42:54 GMT
Content-Type: image/png
Content-Length: 18918
Connection: keep-alive
Last-Modified: Mon, 01 Sep 2014 10:56:10 GMT
ETag: "540450ca-49e6"
Accept-Ranges: bytes