nginx静态资源动态压缩
nginx开启gzip压缩
server {
listen 80;
listen [::]:80;
server_name localhost;
server_tokens off;
# 开启gzip压缩
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain application/css text/css application/xml text/javascript application/javascript application/x-javascript;
#szxblog 前端
location /jxbp {
alias /usr/local/szxblog;
index index.html;
try_files $uri $uri/ /dist/index.html;
}
}
然后重启
nginx:nginx -s reload