nginx使用gzip作为默认路由

时间:2018-02-20 15:13:10

标签: php nginx gzip

我为nginx网站启用了gzip:

    gzip on;
    gzip_vary on;
    gzip_min_length 1024;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types text/plain text/css text/html text/xml text/javascript application/x-javascript application/xml;
    gzip_disable "MSIE [1-6]\.";

虽然它在我通过执行测试它时起作用:curl -H" Accept-Encoding:gzip" -I http://domain/test.html

HTTP/1.1 200 OK
Date: Tue, 20 Feb 2018 15:03:43 GMT
Content-Type: text/html
Connection: keep-alive
Set-Cookie: __cfduid=(CUT!); expires=Wed, 20-Feb-19 15:03:43 GMT; path=/; domain=..com; HttpOnly
Last-Modified: Tue, 20 Feb 2018 14:56:53 GMT
Vary: Accept-Encoding
Server: cloudflare
CF-RAY: (CUT!)
Content-Encoding: gzip

,当我为http://domain/执行卷曲时,我得到了:

HTTP/1.1 200 OK
Date: Tue, 20 Feb 2018 15:05:57 GMT
Content-Type: text/html;charset=UTF-8
Connection: keep-alive
Set-Cookie: __cfduid=(CUT!); expires=Wed, 20-Feb-19 15:05:57 GMT; path=/; domain=.(CUT!).com; HttpOnly
Set-Cookie: grav-site-(CUT!)=(CUT!); expires=Tue, 20-Feb-2018 15:35:57 GMT; Max-Age=1800; path=/; domain=(CUT!).com
Pragma: no-cache
Set-Cookie: grav-site-(CUT!)=(CUT!); expires=Tue, 20-Feb-2018 15:35:57 GMT; Max-Age=1800; path=/; domain=(CUT!).com; HttpOnly
Cache-Control: max-age=604800
Expires: Tue, 27 Feb 2018 15:05:57 GMT
Content-Encoding: none
Server: cloudflare
CF-RAY: (CUT!)

/ request被转发到fastcgi来处理php脚本..

我错过了什么?

0 个答案:

没有答案