listen 80 default deferred; # 默認的server
server_name _; # 只接受IP訪問
access_log /var/log/nginx/status_access.log;
stub_status on; # 打開status監控
access_log off;
allow 127.0.0.1;
deny all;
}
worker_processes 4; # nginx進程數
worker_cpu_affinity 0001 0010 0100 1000; #進程所使用的cpu號
worker_rlimit_nofile 65535; # 進程所打開的句柄數
use epoll;
worker_connections 10240;
}
http {
gzip_types text/xml text/css application/x-javascript;
gzip_min_length 1000;
gzip_vary on; #讓Nginx前端的Squid 2.5/2.6緩存服務器能夠緩存經過gzip壓縮的頁面。
gzip_comp_level 9;
access_log /var/log/nginx/access_cache.log cache;
proxy_cache_key $host$request_uri;
proxy_pass http://proxy_pass;
proxy_cache CNAME;
proxy_cache_valid 200 301 302 10m;
}