server
{
listen 80;
listen 802;
server_name test111.xxxx.com 118.24.122.131;
#charset koi8-r;
location / {
proxy_pass http://127.0.0.1:82;
# $host 变量,Host 为变量名
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
#access_log logs/host.access.log main;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
root html;
index index.html index.htm default.aspx;
proxy_connect_timeout 600;
proxy_read_timeout 600;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
来源:https://www.cnblogs.com/dfsxh/p/11667193.html