【发布时间】:2019-04-12 03:20:07
【问题描述】:
我正在设置 nginx 以使用代理服务两个网站,如下所示,
server {
listen 80;
proxy_set_header HOST $proxy_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
location / {
proxy_pass http://<website-1>;
proxy_read_timeout 300;
}
location /bmo {
proxy_pass http://<website-2>;
proxy_read_timeout 300;
}
}
到 website-1 的代理正在工作,但 website-2 出现错误 404。请告诉我如何解决这个问题。
【问题讨论】:
-
代理是否有效?那么你能在
website-2上看到访问权限吗(例如在日志文件中)? -
访问日志收到此消息:"GET /favicon.ico HTTP/1.1" 404 570 "awspad12345.com/bmo" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36" "-" awspad12345.com 是配置 nginx 的服务器。
标签: nginx nginx-location nginx-reverse-proxy nginx-config