Nginx gzip压缩

http {
    gzip                on;
    gzip_min_length     1k;
    gzip_buffers        4 16k;
    gzip_http_version   1.0;
    gzip_comp_level     6;
    gzip_types          text/plain application/javascript application/x-javascript text/javascript text/xml text/css font/ttf font/otf image/svg+xml;
    gzip_disable        "MSIE [1-6]\.";
    gzip_vary           on;
}

server {
  location ~* ^.+\.(eot|ttf|otf|woff|svg)$ {
    access_log  off;
    expires     max;
  }
}

参考资料:
Nginx 开启gzip 压缩
Nginx开启Gzip压缩大幅提高页面加载速度
Nginx开启 gzip和缓存