你在nginx.conf文件中加入如下配置:
gzip on; gzip_proxied any; gzip_types text/plain text/xml text/css application/x-javascript; gzip_vary on;
之后重启nginx服务就可以了。