nginx php gzip,nginx/tengin 没有开启php文件的gzip,但是为什么返回头却有Content-Encoding: gzip...

nginx gzip 配置如下:

gzip on;

gzip_min_length 1k;

gzip_buffers 4 16k;

gzip_http_version 1.0;

gzip_comp_level 2;

gzip_types text/plain application/x-javascript application/javascript text/css application/xml;

gzip_vary on;

用 curl 或 chrome 测试

$curl -I -H "Accept-Encoding: gzip, deflate" "http://localhost/template/tpl_header.php"

HTTP/1.1 200 OK

Server: Tengine/2.1.0

Date: Sat, 05 Sep 2015 16:40:34 GMT

Content-Type: text/html

Connection: keep-alive

Vary: Accept-Encoding

X-Powered-By: PHP/5.5.27

Content-Encoding: gzip

请求 jpg 图片则正常

curl -I -H "Accept-Encoding: gzip, deflate" "http://localhost/asset/image/common/bg.jpg"

HTTP/1.1 200 OK

Server: Tengine/2.1.0

Date: Sat, 05 Sep 2015 16:43:36 GMT

Content-Type: image/jpeg

Content-Length: 4817

Last-Modified: Sat, 15 Aug 2015 13:12:10 GMT

Connection: keep-alive

ETag: "55cf3aaa-12d1"

Expires: Mon, 05 Oct 2015 16:43:36 GMT

Cache-Control: max-age=2592000

Accept-Ranges: bytes

请问这是什么原因?

附上编译参数:

./configure --prefix=/usr/local/nginx --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --conf-path=/etc/nginx/nginx.conf --with-http_stub_status_module --with-http_ssl_module --with-http_gzip_static_module --pid-path=/var/run/nginx.pid --with-cc-opt="-Wno-deprecated-declarations"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值