- Newest
- Most votes
- Most comments
When you can SSH into your EC2 instance but can't access it via HTTP/HTTPS, there are several potential causes to investigate:
- Network ACLs: Unlike security groups, Network ACLs are stateless and require both inbound and outbound rules. Check that your subnet's Network ACLs allow:
- Inbound rules for HTTP/HTTPS (ports 80/443)
- Outbound rules for ephemeral ports (1024-65535) to allow return traffic
-
Route Table Configuration: Verify that your subnet has a route table with a default route (0.0.0.0/0) pointing to an Internet Gateway (IGW).
-
OS-level Firewall: The snapshot might have captured a state where the OS-level firewall (like iptables for Linux) was configured to block incoming web connections. Check and modify these settings if necessary.
-
Web Server Status: Since you can SSH in, check if the web server is actually running:
sudo systemctl status apache2 # For Apache
sudo systemctl status nginx # For Nginx
If it's not running, start it with:
sudo systemctl start apache2 # For Apache
sudo systemctl start nginx # For Nginx
-
Web Server Configuration: The web server configuration might be bound to the old instance's IP address. Check the configuration files to ensure they're properly set up for the new instance.
-
Application Issues: If the web application itself has hardcoded references to the old instance's hostname or IP, it might not work correctly on the new instance.
Since you can SSH into the instance, the network connectivity is working at a basic level. The issue is more likely related to the web server configuration or application settings that were captured in the snapshot but need to be updated for the new instance.
Sources
EC2 instance from Snapshot not accessible | AWS re:Post
EC2 instance with public IP can't access internet (HTTPS 443 timeout) | AWS re:Post
The connection has timed out. No access to ec2 | AWS re:Post
Relevant content
asked 2 years ago
