Nginx proxy_pass 到错误的上游

问题描述

在我的服务器块中,我已经配置了这个位置

location  / {
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-SERVER-ADDR $server_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:8085;
    }

一切都如我所愿。但是今天下午我在 13 秒内收到了 1,553 个错误。以下是示例错误日志:

2021/05/26 17:32:56 [error] 12754#0: *95156579 no live upstreams while connecting to upstream,client: 27.216.137.199,server: example.com,request: "POST /home/scenario/gamePreLoad HTTP/1.1",upstream: "http://localhost/home/scenario/gamePreLoad",host: "example.com"

起初我以为我的服务已关闭。但是日志显示nginx把请求传给了localhost以外的localhost:8085,很奇怪。

我也查看了操作日志,当时没有人更改nginx配置文件。

我想知道为什么 Nginx proxy_pass 到错误的上游,为什么这件事发生了?

任何帮助将不胜感激!

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)