user nginx nginx;
worker_processes [number|auto];
worker_cpu_affinity 00000001 00000010 00000100 00001000;
error_log /apps/nginx/logs/error.log error;
pid /apps/nginx/logs/nginx.pid;
worker_priority 0;
worker_rlimit_nofile 65536;
daemon off;
master_process off|on;
server_tokens off;
include /apps/nginx/conf.d/*.conf
events {
worker_connections 65536;
use epoll;
accept_mutex on;
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_requests 3;
keepalive_timeout 65 60;
server {
listen 80;
server_name localhost;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
access_log /data/nginx/logs/www-magedu-net_access.log;
error_log /data/nginx/logs/www-magedu-net_error.log;
try_files $uri $uri/index.html $uri.html =489;
location / {
root html;
index index.html index.htm;
deny 192.168.1.1;
allow 192.168.1.0/24;
}
location ~ /passwd.html {
deny all;
}
location = /favicon.ico {
root /data/nginx/html/pc/images;
}
}
location /nginx_status {
stub_status;
}
常见优化:
worker_connections 65536;
use epoll;
accept_mutex on;
multi_accept on;
转载请注明原文地址:https://ipadbbs.8miu.com/read-15533.html