server {
listen 80;
root /var/www/domains/domain.com;
server_name api.domain.com;
location / {
proxy_pass http://127.0.0.1:3501;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
#...
[error] 17984#0: *25 connect() failed (111: Connection refused) while connecting to upstream,
client: 10.0.0.185, server: api.domain.com, request: "GET / HTTP/1.0",
upstream: "http://127.0.0.1:3501/", host: "api.domain.com"
proxy_set_header Connection $connection_upgrade;
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:8888 0.0.0.0:* LISTEN 112/python
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 533/master
tcp 0 0 0.0.0.0:1443 0.0.0.0:* LISTEN 110/python
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1/init
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 660/nginx: master p
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 228/sshd
tcp6 0 0 ::1:25 :::* LISTEN 533/master
tcp6 0 0 :::3306 :::* LISTEN 225/mysqld
tcp6 0 0 :::3501 :::* LISTEN 902/node
tcp6 0 0 :::80 :::* LISTEN 660/nginx: master p
tcp6 0 0 :::21 :::* LISTEN 552/proftpd: (accep
tcp6 0 0 :::22 :::* LISTEN 228/sshd