大家好,我是 Linux 新手。我使用 VMware Workstation 在我的虚拟机上安装了 archivematica。我按照以下指南操作,但当我尝试使用其 IP 地址 172.16.0.12:8000 或甚至不使用端口号访问此机器时,我收到错误消息
502 Bad Gatewaynginx/1.18.0 (Ubuntu).
即使我使用curl
我也得到同样的错误
arch@archeieve:~$ tail -f /var/log/nginx/error.log
2022/06/18 12:13:33 [error] 1200#1200: *1 connect() failed (111: Connection refused) while connecting to upstream, client: 127.0.0.1, server: , request: "GET /HTTP/1.1", upstream: "http://127.0.0.1:8001/", host: "127.0.0.1:8000"
ii2022/06/18 12:14:47 [error] 1200#1200: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 172.16.0.236, server: , request: "GET / HTTP/1.1", upstream: "http://127.0.0.1:8001/", host: "172.16.0.12:8000"
2022/06/18 12:14:47 [error] 1200#1200: *3 connect() failed (111: Connection refused) while connecting to upstream, client: 172.16.0.236, server: , request: "GET/favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:8001/favicon.ico", host: "172.16.0.12:8000", referrer: "http://172.16.0.12:8000/"
arch@archeieve:~$ tail -f /var/log/nginx/access.log
127.0.0.1 - - [18/Jun/2022:12:13:33 +0000] "GET / HTTP/1.1" 502 166 "-" "curl/7.68.0"
172.16.0.236 - - [18/Jun/2022:12:14:47 +0000] "GET / HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"
172.16.0.236 - - [18/Jun/2022:12:14:47 +0000] "GET /favicon.ico HTTP/1.1" 502 568 "http://172.16.0.12:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"
172.16.0.236 - - [18/Jun/2022:12:18:07 +0000] "GET / HTTP/1.1" 502 568 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"
172.16.0.236 - - [18/Jun/2022:12:18:07 +0000] "GET /favicon.ico HTTP/1.1" 502 568 "http://172.16.0.12:8000/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"
以下是 IPtables 的配置行
Chain ufw-user-input (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:8000
ACCEPT tcp -- anywhere anywhere tcp dpt:8002
ACCEPT tcp -- anywhere anywhere tcp dpt:https
识别和解决该问题的主要步骤是什么?
答案1
据我所知,此错误“连接到上游时失败(111:连接被拒绝)”意味着 nginx 想要传递连接的服务未启动或未响应超时限制。
因此,请检查您链接的教程中列出的服务是否已启动,例如
sudo systemctl status archivematica-mcp-server
sudo systemctl status archivematica-storage-service
sudo systemctl status archivematica-dashboard
如果其中一个未启动(活动),则调查其未启动的原因