解决:Docker——No route to host) while connecting to upstream
According to the error message: the situation is that there is no route to the specified hosts
problem analysis
View log file
The error message is as shown:
Actual situation: Can be routed to port 8080 but not routed to port 8081 and 8082
After analysis, judge: This is probably the reason for the firewall
So check the open ports by the following method
firewall-cmd --permanent --zone=public --list-ports
Found that port 8081 and port 8082 are not open
Solution
Use the following command to open the port to be routed
firewall-cmd --permanent --zone=public --add-port=8081/tcp
Restart firewall
firewall-cmd --reload
You can refer to the following blog:
Linux firewall open/close designated port
to sum up
When there is a problem with nginx, you can first look at the log file information without any ideas, there will be error messages, which can tell you which aspect may be wrong, and then look for specific solutions.