nginx反向代理时丢失端口的解决办法

端口丢失,需加:proxy_set_header Host $host:$server_port;
server {
listen 90;
server_name taobye.com;
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;
proxy_set_header Host $host:$server_port; #这样配置就不会出现丢失端口问题
location / {
proxy_pass http://127.0.0.1:7001;
}
location = /50x.html {
root html;
}
}
正在加载评论...