Skip to content

EC2 Website Connection Timeout

0

Hi, I’m unable to connect to a public-facing web app hosted on an EC2 instance. It was working fine yesterday. Now, I receive the following browser errors: Enter image description here

What could be possible cause of this error and Any recommendation to fix this error.

1 Answer
1
Accepted Answer

When you encounter a connection timeout error for a website hosted on an EC2 instance that was previously working, there are several potential causes to investigate:

  1. Security Group Configuration: Verify that your EC2 instance's security group allows incoming traffic on ports 80 (HTTP) and 443 (HTTPS) from all sources (0.0.0.0/0).

  2. Web Server Status: Your web server (Apache, Nginx, etc.) might have stopped running. Try restarting the web server service on your EC2 instance.

  3. Database Connection Issues: If your website relies on a database (like RDS), check if the connection count is 0 or if there are connectivity issues between your EC2 and the database. Test the database connection using command-line tools.

  4. Network Configuration: Ensure that your subnet's route table includes a route for internet-bound traffic pointing to the internet gateway.

  5. IP Address Changes: If you recently associated or disassociated an Elastic IP, your web server configuration might need to be updated to reflect the new IP address.

  6. Application Configuration: Your application might have hardcoded IP addresses or domain names that need to be updated.

  7. Instance Health: Check if your EC2 instance is experiencing high CPU usage or other performance issues.

To troubleshoot and fix this issue:

  1. SSH into your EC2 instance to verify it's running properly.
  2. Check your web server logs for any error messages.
  3. Restart your web server service.
  4. Verify that your application can connect to any required databases.
  5. If you recently made DNS changes, be aware that propagation can take up to 48 hours.
  6. Try accessing the site using the EC2 instance's public IP directly to rule out DNS issues.
  7. As a last resort, consider restarting the EC2 instance.
    Sources
    EC2 Instance that get ERR_CONNECTION_TIMED_OUT | AWS re:Post
    Troubleshoot connection errors | AWS re:Post
    Suddenly the domain connection fails. | AWS re:Post
    No longer have http access to EC2 instance after elastic IP associated | AWS re:Post
answered a year ago
AWS
EXPERT
reviewed a year 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.