nginx代理返回静态文件中路径不带端口的问题
修改配置文件/etc/nginx/nginx.conf
将proxy_set_header Host $host;改为proxy_set_header Host $host:$server_port;
server {
listen 8086;
server_name localhost;
#gzip off;
location / {
proxy_set_header Host $host:$server_port; # 这里加上$host:$server_port
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://10.***.***.46:8086/;
proxy_set_header X-Forwarded-Proto $scheme;
#sub_filter 'src="/' 'src="http://111.***.***.61:8086/';
#sub_filter_once off;
}
}
标签:set,header,端口,server,nginx,host,不带,proxy
From: https://www.cnblogs.com/muphy/p/18563635