We are receiving ‘connection refused’ on nginx. We run several node apps and server those using nginx reverse proxy on different ports. ports are allowed through ufw. apps are running and doing what they are supposed to do. Still this error. ufw.log showing :
May 24 21:58:42 ubuntu-1gb-nyc2-01 kernel: [70662.714517] [UFW BLOCK] IN=eth0 OUT= MAC=04:01:a7:ee:06:01:4c:96:14:a4:ab:f0:08:00 SRC=220.127.116.11 DST=18.104.22.168 LEN=52 TOS=0x18 PREC=0x00 TTL=47 ID=1656 DF PROTO=TCP SPT=4385 DPT=9121 WINDOW=700 RES=0x00 ACK FIN URGP=0
Where as port 4385 is allowed.
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:80 0.0.0.0:* LISTEN 1262/nginx tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1040/sshd tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 1132/postgres tcp 0 0 127.0.0.1:27017 0.0.0.0:* LISTEN 1044/mongod tcp 0 0 127.0.0.1:3306 0.0.0.0:* LISTEN 1095/mysqld tcp6 0 0 :::22 :::* LISTEN 1040/sshd tcp6 0 0 :::11000 :::* LISTEN 2113/node tcp6 0 0 :::5432 :::* LISTEN 1132/postgres tcp6 0 0 :::11100 :::* LISTEN 2099/node tcp6 0 0 :::9117 :::* LISTEN 2015/node tcp6 0 0 :::9118 :::* LISTEN 2029/node tcp6 0 0 :::9121 :::* LISTEN 2142/node tcp6 0 0 :::9122 :::* LISTEN 2072/node tcp6 0 0 :::9125 :::* LISTEN 2085/node tcp6 0 0 :::9130 :::* LISTEN 2045/node
nginx, in our case shall respond to various port ranges, e.g. 3500-3599. Now I allowed those ports in ufw. When try to add again, it says skipping rules already added. But not shown when netstat is run.
Does that mean those ports are not allowed and causing the issue? Any help will be greatly appreciated.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $100 of credit to try our products over 60 days!