nginx 代理配置如下:
server {
listen 80; # nginx: 1.9.1+ Linux: 3.9+
server_name abc.kaixinok.com;
location / {
proxy_pass http://test.kaixinok.com;
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;
}
}
访问 abc.kaixinok.com
报错404 Not Found ,直接访问 test.kaixinok.com
正常。
解决方法:
删除 proxy_set_header Host $host;
配置访问正常。
proxy_set_header Host $host
评论区