- Newest
- Most votes
- Most comments
Hello.
Are you able to connect to websites other than Google using HTTPS?
I think you need to determine whether the problem is with the connection destination or with EC2.
Just to be sure, have you set up your NACL inbound rules to allow ephemeral ports?
For connect from EC2 to google.com, you need to allow HTTPS in the outbound rules, and allow the return connect on an ephemeral port in the inbound rules.
Please check that your NACL inbound rules are set to allow the range "1024-65535".
https://docs.aws.amazon.com/vpc/latest/userguide/custom-network-acl.html#nacl-ephemeral-ports
Based on the information provided, it seems you've covered most of the common causes for internet connectivity issues with EC2 instances. However, there are a few additional areas we can explore:
-
VPC Configuration: Double-check that the VPC itself doesn't have any settings blocking outbound traffic. Look for any VPC-level block public access settings that might be enabled.
-
Network Interface: Verify that the Elastic Network Interface (ENI) attached to the instance is correctly configured and doesn't have any custom routes or settings that could interfere with outbound traffic.
-
Operating System Firewall: Check if there are any local firewall rules on the EC2 instance itself (e.g., iptables for Linux) that might be blocking outbound HTTPS traffic.
-
MTU Settings: Ensure that the MTU (Maximum Transmission Unit) settings on your instance are correct. Mismatched MTU settings can sometimes cause connectivity issues.
-
VPC Endpoints: If you have any VPC endpoints configured, make sure they're not interfering with your outbound traffic.
-
AWS Network Firewall: Verify that there isn't an AWS Network Firewall rule in place that could be blocking outbound HTTPS traffic.
-
Traceroute Analysis: Run a traceroute to an external HTTPS endpoint to see where the connection is failing. This might provide clues about where in the network path the issue is occurring.
-
VPC Reachability Analyzer: Use the AWS VPC Reachability Analyzer to run a trace from your instance to an external IP address on port 443. This can help identify any network configuration issues.
-
Instance Health: Check the system logs and instance health to ensure there are no underlying issues with the EC2 instance itself.
-
Compare Configurations: Use AWS Config or a similar tool to do a detailed comparison of all network-related configurations between the working and non-working instances to identify any subtle differences.
If none of these suggestions reveal the issue, you may want to consider contacting AWS support for further assistance, as there could be an underlying infrastructure problem or a very subtle configuration issue that's not immediately apparent.
Sources
Internet Connectivity Issue: EC2 Instance Cannot Access the Internet | AWS re:Post
EC2 internet inbound/outbound not working us-east-1, works in all other regions | AWS re:Post
My instances can not access AWS public endpoints | AWS re:Post
Hello everyone,
Thank you for your support and the valuable guidance so far.
Based on the suggestions provided, I have reviewed and implemented the following:
- The EC2 instance is in a public subnet and has a public IP assigned.
- The route table correctly points the default route (0.0.0.0/0) to an Internet Gateway (IGW).
- The Security Group allows outbound traffic to all destinations and all ports.
- The Network ACL (NACL) has inbound rules allowing ports:
- TCP 443 (HTTPS)
- TCP 80 (HTTP)
- TCP 22 (SSH)
- Ephemeral ports 1024–65535 from 0.0.0.0/0
- The outbound NACL rules also allow:
- TCP 443 (HTTPS)
- TCP 80 (HTTP)
- TCP 1024–65535 to 0.0.0.0/0
ufwis disabled, andiptablesshows policy ACCEPT for all chains.- MTU settings tested via
ping -M do -s 1472 8.8.8.8are working. - The VPC Reachability Analyzer confirms the path from the EC2 instance to 8.8.8.8:443 is reachable.
Despite all of this, the instance cannot reach external services via HTTPS.
- Example:
curl -v https://1.1.1.1results in a timeout. sudo apt updatefails due to unreachable mirrors.- I cannot install
tracerouteortelnetdue to lack of connectivity.
I believe all configuration aspects have been covered. If there are any advanced checks or further ideas, I’d greatly appreciate your input.
Thanks again for your time and assistance.
Please share your NACL rules in and outbound as I suspect they may have not been setup correctly
Hi everyone! Just wanted to thank you all for the helpful suggestions and support.
After extensive troubleshooting — including checking route tables, SGs, NACLs, MTU, and using Reachability Analyzer — I decided to create a new EC2 instance from an AMI of the original one. This allowed me to retain all applications and configurations, while resolving the HTTPS connectivity issue entirely.
Everything is now working as expected. I really appreciate the guidance and insights from this community — it helped a lot!
Best regards, Paulo Cesar
answered a year ago
Related links; https://letsencrypt.org/how-it-works/ https://sucuri.net/guides/how-to-install-ssl-certificate/
AI answered this to me;
This recommendation was generated using AWS Generative AI capabilities. You are responsible for evaluating the recommendation in your specific context and implementing appropriate oversight and safeguards. Learn more This answer has not been reviewed by an expert The issue you're experiencing is likely related to your web server configuration rather than an AWS networking problem.
When you say the HTTP URLs work but HTTPS URLs don't, this suggests that:
Your EC2 instance is properly configured for network connectivity (since HTTP works) Your web server is running and responding to HTTP requests Your web server is either not configured for HTTPS or is missing SSL/TLS certificates For HTTPS to work, you need to:
Install and configure SSL/TLS certificates on your web server Configure your web server to listen on port 443 (HTTPS) Ensure your security groups allow inbound traffic on port 443 Regarding DNS records not resolving for your server's default web page, this is likely because:
DNS records only map hostnames to IP addresses The web server needs to be configured to respond to requests using those hostnames (virtual hosting) To fix these issues:
Set up SSL/TLS certificates (you can use Let's Encrypt for free certificates) Configure your web server with the proper virtual host settings for your domain names Verify your security groups allow traffic on ports 80 (HTTP) and 443 (HTTPS) Make sure your DNS records are correctly pointing to your EC2 instance's IP addresses Sources EC2 instance with public IP can't access internet (HTTPS 443 timeout) | AWS re:Post Amazon EC2 instance IP addressing - Amazon Elastic Compute Cloud
answered a year ago
Relevant content
asked 3 years ago
asked 2 years ago
asked 3 years ago

Can you set the inbound and outbound rules of the NACL to allow all communication and check if that changes the behavior? Also, please check that the NACL associated with the subnet in which the EC2 instance is running matches the NACL reflecting the settings.
If you launch a new EC2 in the same subnet and do the same test, does it work?