linux-tutorial/codes/linux/soft/config/nginx/nginx.conf

37 lines
1022 B
Nginx Configuration File
Raw Normal View History

2019-05-15 22:43:15 +08:00
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /usr/local/nginx/logs/nginx.pid;
events {
worker_connections 1024;
}
http {
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/nginx-http-access.log;
sendfile on;
rewrite_log on;
keepalive_timeout 65;
client_max_body_size 20m;
client_body_buffer_size 128k;
#common header set
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
include mime.types;
include conf/*.conf;
}