1

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 0.0.0.0/0
  • SSH - Port Range 22 - Source 0.0.0.0/0
  • HTTPS Port Range 443 - Source 0.0.0.0/0

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? – serverliving.com Oct 12 '16 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 '16 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 '16 at 15:24
2

The server is accepting connections on port 80 fine:

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

There is likely an issue in your webserver configuration.

EDIT:

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--  http://52.208.91.148/
Connecting to 52.208.91.148:80... 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... 52.209.134.209
Connecting to ec2-52-209-134-209.eu-west-1.compute.amazonaws.com|52.209.134.209|:80
0

You can test the redirection with Curl as below.

curl -I vv 52.208.91.148
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 acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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