upstream server temporarily disabled while connecting to upstream(记录bug)

简介: upstream server temporarily disabled while connecting to upstream(记录bug)

场景


connect() failed (111: Connection refused) while connecting to upstream, client: 172.17.0.1, server: localhost, request: "GET /api/?token=success HTTP/1.1", subrequest: "/auth", upstream: "http://127.0.0.1:8080/verify?token=success", host: "localhost"

在nginx访问接口的时候,去做一些权限的校验。只有校验通过才能访问接口,否则就直接返回失败。


但是在调用上游接口的时候,一直提示上游服务暂时禁用。但是上游服务可以保证一定运行着,并且可以访问通。所以通过查阅前人总结发现。原来每个容器内的本地主机(如Nginx容器)与容器外部的本地主机不同。


解决办法


proxy_pass localhost:8080”中的本地主机更改为“×.×.×.×”(这是我计算机中的IPv4)即可解决这个问题。

目录
相关文章
|
缓存 网络协议 开发工具
Server is unreachable 服务器不可及
Server is unreachable 服务器不可及
972 0
Server is unreachable 服务器不可及
|
4月前
|
应用服务中间件 nginx Docker
connect() failed (113: No route to host) while connecting to upstream
connect() failed (113: No route to host) while connecting to upstream
150 0
|
6月前
Failed to connect to apiserver: the server has asked for the clieto provide credentials
Failed to connect to apiserver: the server has asked for the clieto provide credentials
46 0
|
6月前
|
测试技术
Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded 的解决办法
Could not proxy command to the remote server. Original error: timeout of 240000ms exceeded 的解决办法
238 0
|
Java 应用服务中间件 PHP
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
622 0
Nginx——*5 connect() failed (111: Connection refused) while connecting to upstream
|
应用服务中间件 网络安全 nginx
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
nginx开启ssl报错: [emerg] "server" directive is not allowed here ...
342 0
|
关系型数据库 MySQL 数据库
MySql错误 1251 - Client does not support authentication protocol requested by server
MySql错误 1251 - Client does not support authentication protocol requested by server
91 0
|
网络虚拟化
ValueError: check_hostname requires server_hostname的解决办法
报错ValueError: check_hostname requires server_hostname通常是因为版本冲突等原因,查遍网上众多大佬总结的经验后,最终发现是由网络代理导致的问题,即我们通常说的vpn问题。
293 0
服务器重启后 Host key verification failed
服务器重启后 Host key verification failed
145 0
服务器重启后 Host key verification failed
|
固态存储 网络协议 Linux
The remote SSH server rejected X11 forwarding request
The remote SSH server rejected X11 forwarding request
435 0
The remote SSH server rejected X11 forwarding request