I have an AWS EC2 Instance that can be accessed via SSH but will not load via its public IP. The page continually loads and then times out.

I have checked the security group and the following is allowed in luanch wizard 1 (the only security group):

  • HTTP - Port Range 80 - Source
  • SSH - Port Range 22 - Source
  • HTTPS Port Range 443 - Source

Public IP

Any ideas?

Edit* It is an EC2 Instance running Linux, Apache, MySQL and PHP.

  • It might be possible that HTTP port is not open in your EC2 instance's firewall. Is that a ubuntu or a centos server? Oct 12, 2016 at 10:24
  • You need to run a web service like apache or nginx. I think you can not visit directly with public dns. Install apache and try accessing by ip address. If you are using cent os install http
    – gloom700
    Oct 12, 2016 at 11:19
  • Did you manage to solve this issue? Was there a redirect in place in the Apache configuration file(s) - as suggested below?
    – David B.
    Oct 13, 2016 at 15:24

2 Answers 2


The server is accepting connections on port 80 fine:

telnet 80
Connected to ec2-52-208-91-148.eu-west-1.compute.amazonaws.com.
Escape character is '^]'.

There is likely an issue in your webserver configuration.


You seem to have a redirect in place in your server config that is redirecting to a server that is not accepting connections:

--2016-10-12 14:42:46--
Connecting to connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://ec2-52-209-134-209.eu-west-1.compute.amazonaws.com/ [following]
--2016-10-12 14:42:47--  http://ec2-52-209-134-209.eu-west-1.compute.amazonaws.com/
Resolving ec2-52-209-134-209.eu-west-1.compute.amazonaws.com...
Connecting to ec2-52-209-134-209.eu-west-1.compute.amazonaws.com||:80

You can test the redirection with Curl as below.

curl -I vv
HTTP/1.1 302 Moved Temporarily
Server: nginx
Date: Thu, 13 Oct 2016 10:56:12 GMT
Content-Type: text/html
Content-Length: 154
Connection: keep-alive

And if there is some redirection configured, that has been already answered in the another thread..

In Nginx, how can I rewrite all http requests to https while maintaining sub-domain?

check this

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.