- user www; #安全性优化,不建议采用root
- pid /var/run/nginx.pid;
- worker_processes 4; #建议将逻辑cpu空闲的都分给它
- worker_cpu_affinity 0001 0010 0100 1000; #将逻辑核和nginx线程做绑定,这个有几个核心就有多少位
- worker_rlimit_nofile 100000; #每个进程可以打开的文件数
- events {
- worker_connections 2048; #最大连接数
- multi_accept on;
- use epoll; #使用非阻塞模型
- }
- http {
- server_tokens off;
- sendfile on;
- tcp_nopush on;
- tcp_nodelay on;
- access_log off; #关闭accesslog
- error_log /var/log/nginx/error.log crit; #error日志级别开大
- keepalive_timeout 10;
- client_header_timeout 10;
- client_body_timeout 10;
- reset_timedout_connection on;
- send_timeout 10;
- limit_conn_zone $binary_remote_addr zone=addr:5m;
- limit_conn addr 100;
- include /etc/nginx/mime.types;
- default_type text/html;
- charset UTF-8;
- gzip on;
- gzip_disable "msie6";
- gzip_proxied any;
- gzip_min_length 1000;
- gzip_comp_level 6;
- gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
- open_file_cache max=100000 inactive=20s; #让文件存在缓存里
- open_file_cache_valid 30s;
- open_file_cache_min_uses 2;
- open_file_cache_errors on;
- include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-enabled/*;
- }
posted @
2017-04-04 23:06
好大的月亮
阅读(
102)
评论()
编辑
收藏
举报