基本配置
最后更新于:2022-04-02 05:41:48
## nginx配置
* 查看cpu核心数,worker配置需要:
`cat /proc/cpuinfo | grep physical | sort -n | uniq | wc -l`
- [nginx配置参考文档](http://www.runoob.com/w3cnote/nginx-install-and-config.html)
## gzip压缩
Nginx 优化配置
Gzip压缩:
~~~
http {
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_min_length 1000;
gzip_proxied any;
gzip_disable "msie6";
gzip_http_version 1.0;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript;
... ...
}
~~~
';