ngnix 502:连接到上游时失败(111:连接被拒绝)

时间:2020-03-17 14:43:56

标签: javascript php node.js amazon-ec2

server {
listen 80;
server_name example1.com;
location / {
proxy_pass http://localhost:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}

server {

listen 80;
server_name example2.com;
location / {

proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;

}

}

错误日志:

2020/03/17 14:13:44 [error] 1880#1880: *88 connect() failed (111: Connection refused) while connecting to upstream, client: 157.37.238.120, server: example1.com, request: "GET /HTTP/1.1", upstream: "http://127.0.0.1:3000/", host: "www.example1.com"
2020/03/17 14:13:44 [error] 1880#1880:*88 connect() failed (111: Connection refused) while connecting to upstream, client: 157.37.238.120, server: example.com, request: "GET /favicon.ico HTTP/1.1", upstream: "http://127.0.0.1:3000/favicon.ico", host: "www.example1.com", referrer: "http://www.example1.com/"

0 个答案:

没有答案