0
我想弄清楚爲什麼Nginx不壓縮CSS。 Nginx配置看起來像這樣的任務是有效的和典型的。Nginx不壓縮CSS文件
失敗測試:
curl -H "Accept-Encoding: gzip" -I https://<hostname>/sites/default/files/css/css_xLFDRTFqZTZeUg7Pab0gP4cpz5TWo3PCH-KBo_HKQ6A.css
HTTP/1.1 200 OK
Server: nginx
Content-Type: text/css
Content-Length: 1123
ETag: "587c4cdc-463"
Cache-Control: max-age=2592000
Accept-Ranges: bytes
響應內容編碼應的gzip代替文本/ CSS。
Nginx的配置:
http {
...
gzip on;
gzip_buffers 16 8k;
gzip_comp_level 2;
gzip_http_version 1.1;
gzip_min_length 10240;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/x-icon application/vnd.ms-fontobject font/opentype application/x-font-ttf;
gzip_vary on;
gzip_proxied any;
gzip_disable msie6;
...
}
它的工作原理,謝謝! –