Failed to connect to 127.0.0.1 port 80: Connection refused
By Emma Payne •
I am unable to connect to port 80 on an ec2 VM.
I even tried this below command.
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPTBut no change in the response.
My security group inbound rules also say HTTP TCP 80 anywhere.
Is there anything else I can do to open port 80?
11 Answer
Have you tried running sudo ufw stop? ufw is a builtin firewall program that may be blocking your access. Also make sure that 127.0.0.1 isn't be assigned to some other address in /etc/hosts