AWS Linux instance public IP is not working

Welcome to Programming Tutorial official website. Today - we are going to cover how to solve / find the solution of this error AWS Linux instance public IP is not working on this date .

I have created an AWS EC2 Linux instance and installed Nginx on it. Both EC2 and Nginx statuses are “Running“. The problem is both Public IP and DNS are not working. When I put the public IP to the browser, it is keep loading for a while and then shows “This site can’t be reached”

I tried by adding a new Inbound rule with Custom TCP and still the result is the same.

The VPC is also in the “Available” state and the IPv4 CIDR status is “Associated“.

What could be the issue here?

Answer

Some steps to pay attention to:

  1. In the security group your instance you have to enable HTTP inbound traffic on port 80 from anywhere:
    enter image description here
    This will let your EC2 instance receive HTTP traffic (not HTTPS!)
  2. When you put the IP address in your browser, make sure you specify the protocol: http://1.2.3.4/.... It is important to explicitly type out http, because nowadays browsers default to using HTTPS. You do not allow HTTPS traffic yet.

At this point you should have HTTP connection. For HTTPS you would want to allow inbound traffic on port 443 and you would have to set up SSL, but this falls outside of the scope of this question.