http的内部配置
proxy_set_header Host $host;
proxy _ set _ headerx-real-IP $ remote _ addr;
proxy _ set _ headerx-forwarded-for $ proxy _ add _ x _ forwarded _ for;
vue npm项目压缩打包,访问nginx配置
1 .安装
完成后,用./nginx -s reload重新加载nginx即可
#配置./configure-- prefix=/usr/local/nginx-- with-http _ gzip _ static _ module # #标记安装重新安装
2 .部署
gzip on;
gzip_static on;
gzip_comp_level 2;
GIP _ types text/plaintext/htmltext/CSS application/x-JavaScript text/XML application/XML application/xmlrstext
参考:vue封装gzip压缩两种方案_一只前端客户端-CSDN博客