1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
| [root@localhost ~]# curl 127.0.0.1:8081
THIS IS TOMCAT 8081
[root@localhost ~]# curl 127.0.0.1:8082
THIS IS TOMCAT 8082
[root@localhost ~]# curl 127.0.0.1
<!DOCTYPE html>
<html>
<head>
<title>Error</title>
<style>
html { color-scheme: light dark; }
body { width: 35em; margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif; }
</style>
</head>
<body>
<h1>An error occurred.</h1>
<p>Sorry, the page you are looking for is currently unavailable.<br/>
Please try again later.</p>
<p>If you are the system administrator of this resource then you should check
the error log for details.</p>
<p><em>Faithfully yours, nginx.</em></p>
</body>
</html>
[root@localhost ~]# tail -f /var/log/nginx/error.log
2026/04/13 16:10:05 [warn] 34388#34388: *1 upstream server temporarily disabled while connecting to upstream, client: 192.168.157.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8082/", host: "192.168.157.129"
2026/04/13 16:10:05 [crit] 34388#34388: *1 connect() to 127.0.0.1:8081 failed (13: Permission denied) while connecting to upstream, client: 192.168.157.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "192.168.157.129"
2026/04/13 16:10:05 [warn] 34388#34388: *1 upstream server temporarily disabled while connecting to upstream, client: 192.168.157.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8081/", host: "192.168.157.129"
2026/04/13 16:10:06 [error] 34388#34388: *1 no live upstreams while connecting to upstream, client: 192.168.157.1, server: localhost, request: "GET / HTTP/1.1", upstream: "http://tomcat_cluster/", host: "192.168.157.129"
#SELinux 拦截
getenforce # 输出Enforcing
# 临时解决
[root@localhost ~]# setenforce 0
[root@localhost ~]# curl 127.0.0.1
THIS IS TOMCAT 8082
# 永久解决
setsebool -P httpd_can_network_connect 1
|