28 lines
728 B
Nginx Configuration File
28 lines
728 B
Nginx Configuration File
user web_proxy;
|
||
worker_processes auto;
|
||
|
||
events {
|
||
worker_connections 1024;
|
||
}
|
||
|
||
http {
|
||
include mime.types;
|
||
default_type application/octet-stream;
|
||
sendfile on;
|
||
|
||
# 使用系统 resolv.conf(由 update-dns.sh 动态更新)
|
||
resolver $(awk '/^nameserver/ {print $2}' /etc/resolv.conf | tr '\n' ' ') valid=30s ipv6=off;
|
||
|
||
# 启用访问日志
|
||
access_log /var/log/nginx/access.log;
|
||
error_log /var/log/nginx/error.log;
|
||
|
||
# 反向代理默认头部
|
||
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;
|
||
|
||
include /etc/nginx/conf.d/*.conf;
|
||
}
|