Docker“代理服务器收到来自上游服务器的无效响应。”系统重启后

时间:2021-04-18 14:50:57

标签: docker docker-compose centos7 iptables

我在 CentOS 7 上使用 WHM、CPanels 和 Apache 运行 Docker MERN 堆栈,一切正常,直到我重新启动服务器。我在网页上收到以下错误:

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request

Reason: Error reading from remote server

Additionally, a 502 Bad Gateway error was encountered while trying to use an ErrorDocument to handle the request.

搜索stackoverflow后,我发现如果我运行这个命令,我的问题就解决了:

iptables -t filter -F

我的问题是,是什么导致了我的问题?如何配置我的服务器,以便每次服务器重新启动时都不需要运行此命令?我是否制作了一个脚本来在每次重新启动时运行此命令?我要配置 iptables 吗?

1 个答案:

答案 0 :(得分:0)

只是为了回答我自己的问题,我很笨,忘记打开适当的出站端口,我只打开了入站端口。

相关问题