Question

Port 80 failed: Connection refused

Suddenly my server down !, and when tried curl http://myip -v

* Rebuilt URL to: http://myip/
*   Trying myip...
* connect to myip port 80 failed: Connection refused
* Failed to connect to myip port 80: Connection refused
* Closing connection 0
curl: (7) Failed to connect to myip port 80: Connection refused

How detect the reason ? which log file can i see it ?

Please help.

Subscribe
Share

Submit an 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.

Hi there,

Just came across this question, this could mean that your web server is not running.

I could suggest starting with the following steps on how to troubleshoot common Nginx problems on a Linux server:

https://www.digitalocean.com/community/questions/how-to-troubleshoot-common-nginx-issues-on-linux-server

If you are using Apache you could follow the steps here:

https://www.digitalocean.com/community/questions/how-to-troubleshoot-common-apache-issues-on-linux-server

Regards, Bobby

Despite ufw or any other firewall rules on the Linux system. There are Firewalls rules in the DigitalOcean “Networking” panel. By default, there’s no 80 rule. You need to add HTTP/HTTPS to the firewall rules.

  • On DigitalOcean Control Panel page,
  • Open “Droplets”, select the droplet used
  • Go to “Networking” and check “Firewalls”, make sure there’s a rule: HTTP, TCP, 80, All IPv4 | All IPv6
  • If not, click the firewall group icon (the blue one above)
  • Under “Inbound Rules”
  • Add “New rule” and select HTTP (and HTTPS if needed)
  • Save and the 80 port should be accessible.

Hope this is helpful.

Despite ufw or any other firewall rules on the Linux system. There are Firewalls rules in the DigitalOcean “Networking” panel. By default, there’s no 80 rule. You need to add HTTP/HTTPS to the firewall rules.

  • On DigitalOcean Control Panel page,
  • Open “Droplets”, select the droplet used
  • Go to “Networking” and check “Firewalls”, make sure there’s a rule: HTTP, TCP, 80, All IPv4 | All IPv6
  • If not, click the firewall group icon (the blue one above)
  • Under “Inbound Rules”
  • Add “New rule” and select HTTP (and HTTPS if needed)
  • Save and the 80 port should be accessible.

Hope this is helpful.

I have the same issue - no firewalls are set up, ufw is inactive, and all traffic to port 80 is refused though there is a server listening on it.

sudo netstat -nlp

returns

tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      19843/nginx -g daem

I can successfully curl the ip address or localhost from the droplet, but from anywhere else the connection is refused. Any server on port 80 will yield the same result, not just an nginx one - and any other port (81, 9000, etc) will work

The droplet version is 16.04.4

Hi. Its real trouble. I start Nginx on Ubuntu. Uwf is disabled. I use a command “telnet IP 80” to checking server. When I check it a local or from my other droplet all is ok. But if I try to connect with 80 port from my local machine this port is silenced. And when I’am restarting my Nginx on 8080. It works correctly!!!

Hey, DigitalOcean’s Devs, fix it, please, ASAP!!! %)

Nobody helped him, and I have the same problem. This doesn’t seem very straightforward. I have tried adding port forwarding, but no luck. I wonder if most of what you find is outdated…also, please stop telling people to “Google” when Google is exactly what brought me here.

Nobody helped him, and I have the same problem. This doesn’t seem very straightforward. I have tried adding port forwarding, but no luck. I wonder if most of what you find is outdated…also, please stop telling people to “Google” when Google is exactly what brought me here.

Nobody helped him, and I have the same problem. This doesn’t seem very straightforward. I have tried adding port forwarding, but no luck. I wonder if most of what you find is outdated…also, please stop telling people to “Google” when Google is exactly what brought me here.

Nobody helped him, and I have the same problem. This doesn’t seem very straightforward. I have tried adding port forwarding, but no luck. I wonder if most of what you find is outdated…also, please stop telling people to “Google” when Google is exactly what brought me here.

Check firewall, incase you had disabled for whatever reason and you did a droplet restart it might have come on. Run systemctl stop firewalld , to stop firewalld