Skip to content

can't access new ec2 instance with https

0

I made a snapshot of an ec2 instance, created an AMI and launched the new instance in EC2. it shows in dashboard as running and lists its public IP. I opened ports 22, 443, 80 and 8080 to incoming traffic 0.0.0.0/0. I can ssh into the new instance, but c**annot http to it. **

asked a year ago113 views

1 Answer
0

When you can SSH into your EC2 instance but can't access it via HTTP/HTTPS, there are several potential causes to investigate:

  1. 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
  1. 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).

  2. 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.

  3. 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
  1. 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.

  2. 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

answered a year ago

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.