- Newest
- Most votes
- Most comments
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:
-
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).
-
Web Server Status: Your web server (Apache, Nginx, etc.) might have stopped running. Try restarting the web server service on your EC2 instance.
-
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.
-
Network Configuration: Ensure that your subnet's route table includes a route for internet-bound traffic pointing to the internet gateway.
-
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.
-
Application Configuration: Your application might have hardcoded IP addresses or domain names that need to be updated.
-
Instance Health: Check if your EC2 instance is experiencing high CPU usage or other performance issues.
To troubleshoot and fix this issue:
- SSH into your EC2 instance to verify it's running properly.
- Check your web server logs for any error messages.
- Restart your web server service.
- Verify that your application can connect to any required databases.
- If you recently made DNS changes, be aware that propagation can take up to 48 hours.
- Try accessing the site using the EC2 instance's public IP directly to rule out DNS issues.
- 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
