Server ports 80 and/or 443 are not publicly accessible


Please its been 2 weeks now, have tried everything but each time I telnet telnet <public IP> 443 or telnet telnet <public IP> 80, I keep getting; telnet: Unable to connect to remote host: Connection timed out

And when I do curl -I <public IP> 80, I get curl: (7) Failed to connect to <public IP> port 80: Connection timed out.

My <public IP> is an elastic IP.

NOTE: Outside my instance, I noticed I could telnet to port 80 and 443 using my <public IP> and it works but when I SSH to my instance and telnet or run curl, it doesn't work.

Please help

asked 2 years ago1712 views
3 Answers

If you are experiencing urgent difficulties I would always recommend that you raise a support case. The support team can look at the configuration of your environment and tell if anything is not configured correctly.

Your question seems a little contradictory but let me try and summarise:

  1. You can reach your instance using it's public IP address on TCP/80 and TCP/443 from sources outside AWS.
  2. You cannot reach your instance using it's public IP address on TCP/80 and TCP/443 from the instance itself.

If (1) works from "anywhere" then I'd expect (2) to work as well. Check your security group settings for your instance and make sure you're allowing the appropriate source IP addresses - the default is to allow connections from anywhere so that may not be it.

Second, check the instance firewall/iptables/filtering - it's possible the operating system is blocking connections from specific source (i.e. itself).

profile pictureAWS
answered 2 years ago
  • (1) If I open my mac book terminal and run telnet <my ip address> 80 , it works fine. But if I login to my instance and do the same, it doesn't.

    Have checked my security group, let me share the details

    Name Security group rule ID IP version Type Protocol Port range Source Description

    – sgr-0df8c9fe2829c7388 IPv4 HTTPS TCP 443 –

    – sgr-0b558ba8dd50944b7 IPv4 Custom TCP TCP 9821 –

    – sgr-08022c4eedbace46e IPv4 HTTP TCP 80 –

    – sgr-0a4f619a104e2f6b1 IPv4 HTTP TCP 80 –

    – sgr-06215c91d2c8ae8d3 IPv6 DNS (TCP) TCP 53 ::/0 –

    – sgr-00cb71156aea0c1a2 IPv4 MSSQL TCP 1433 –

    – sgr-08dbf2f4876fa3368 IPv4 Custom TCP TCP 23 –

    – sgr-089f85d08fd10d78a IPv4 Custom TCP TCP 3100 –

    – sgr-0cb24ac402d99ba25 IPv6 Custom TCP TCP 3000 ::/0 –

    – sgr-03dbaa4ebd86acb51 IPv4 Custom TCP TCP 3000 –

    – sgr-022f40b89f0b89bc9 IPv4 SSH TCP 22 –

    – sgr-0873d3ad29edd84aa IPv6 DNS (UDP) UDP 53 ::/0 –

    – sgr-05cbeca10ab32d8a4 IPv4 MYSQL/Aurora TCP 3306 –

    – sgr-0f44c0abaa0d2fc84 IPv4 HTTPS TCP 443 –

    – sgr-09d0c2362a9fc59e4 IPv4 Custom TCP TCP 3120 –

    – sgr-01d68ffc0e10ed4c1 IPv6 Custom TCP TCP 23 ::/0 –

    – sgr-0ba67155310b7bf2a IPv4 All TCP TCP

    MYSQL/Aurora TCP 3306 ::/0 –

    – sgr-023f8fb28c1ecb54c IPv6 HTTP TCP 80 ::/0 –

    – sgr-0c668c169dbe08030 IPv4 Custom TCP TCP 3110 –

    – sgr-03aace2838866c60e IPv4 DNS (TCP) TCP 53 0.

  • Bear in mind a support case is a far better place for this type of question because the support team have the ability to view how your environment is configured. Having this conversation with day-long latency isn't helping you get up and running.

    That said: Do you have any routing in the VPC which is sending traffic via something doing NAT or via a firewall of some sort?


Check the network access list of the VPC your EC2 instance is located

answered 2 years ago

On my security group, port 80 and port 443 are open. Have flushed my iptables, so rules available, no firewalls .

Please what might be the cause.

When I run curl -I , this works, but when I replace with my IP ADDRESS, it doesn't

answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions