- Newest
- Most votes
- Most comments
Hello.
The troubleshooting documentation below may be helpful.
If there are no problems with the settings for the security group or subnet network ACL, HTTP or HTTPS may not be listening within EC2.
Check if your web server process (Apache or Nginx) is running.
https://repost.aws/knowledge-center/ec2-instance-hosting-unresponsive-website
When you can ping an EC2 instance but can't connect via HTTP/HTTPS, there are several potential issues to investigate:
-
Web Server Configuration: Make sure a web server (like Apache, Nginx, etc.) is actually installed, configured, and running on your instance. Just having an EC2 instance running doesn't automatically provide web services.
-
Security Group Settings: While you mentioned your security group has rules for HTTP and HTTPS, verify that:
- The inbound rules specifically allow TCP port 80 (HTTP) and 443 (HTTPS)
- The source is set appropriately (either your IP or 0.0.0.0/0 for public access)
-
Network ACLs: Unlike security groups, Network ACLs are stateless and require both inbound and outbound rules. Check if your subnet's Network ACLs might be blocking web traffic.
-
OS-level Firewall: The instance might have an OS-level firewall (like iptables) blocking incoming web connections.
-
Application Status: If a web server is installed, check its status to ensure it's running properly.
-
Instance Status Checks: Verify that your instance has passed all status checks in the EC2 console.
-
VPC and Subnet Configuration: Ensure your instance is in a public subnet with a route to an Internet Gateway.
Since you can ping the instance and connect via the AWS console, your basic network connectivity is working. The issue is likely related to either the web server not running or a specific configuration blocking web traffic.
Try these troubleshooting steps:
- Connect to your instance via the AWS console
- Check if a web server is installed and running (e.g.,
systemctl status apache2orsystemctl status nginx) - If not installed, install and start a web server
- Check OS-level firewall settings
- Verify the web server is configured to listen on the correct ports
If you've verified all these settings and still can't connect, consider using the VPC Reachability Analyzer to diagnose potential network configuration issues.
Sources
The connection has timed out. No access to ec2 | AWS re:Post
Can not ssh to ec2 instance though no alarms and is running | AWS re:Post
Thanks for the feedback and I'll check these services
Relevant content
asked 2 years ago
asked 2 years ago
asked 3 years ago

Thanks for the feedback and I'll take a look at this