Skip to content

Unable to connect to EC2 instance via https, although I can ping the instance via snmp

0

I have created a new EC2 instance and I have verified that it is up and running. I can ping the public IP address but I cannot connect to it via http or https from my laptop. I have checked the security group and I can see rules for http, https and snmp. I can also connect to the EC2 instance via the AWS console and I can ping out to an external IP address from it, so outbound and inbound routing to it seem to be ok. Can anyone advise as to what to check to see where my error is?

Thanks ,

Mansfield

asked a year ago248 views

2 Answers
0
Accepted Answer

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

EXPERT

answered a year ago

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

0

When you can ping an EC2 instance but can't connect via HTTP/HTTPS, there are several potential issues to investigate:

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

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

  2. OS-level Firewall: The instance might have an OS-level firewall (like iptables) blocking incoming web connections.

  3. Application Status: If a web server is installed, check its status to ensure it's running properly.

  4. Instance Status Checks: Verify that your instance has passed all status checks in the EC2 console.

  5. 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 apache2 or systemctl 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

answered a year ago

EXPERT

reviewed a year ago

  • Thanks for the feedback and I'll check these services

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.