- Newest
- Most votes
- Most comments
Have you opened the appropriate ports in the Security Group to the public or only to you internal IPs?
Hope this helps.
Ensure that your Lightsail IPv4 firewall allows traffic on HTTP port (TCP port 80) and HTTPS port (TCP port 443) from any public IP. For troubleshooting purposes also allow the SSH port 22 from all public IPs in the firewall configuration.
You can troubleshoot this using the following set of network connectivity tests:
- Test connectivity to the public IP address of your lightsail instance using the SSH port. You can do this by running the following commands from an external client such as your laptop or another public linux EC2 instance in a VPC.
telnet <public IP of lightsail instance> 22
or
ssh -i "<ssh key pair>" ec2-user@<public IP of lightsail>
or
nc -vz <public IP of lightsail> 22
If the above commands are successful, this confirms that the network connectivity to the public IP of the lightsail instance is fine and there are no issues. The issue could lie with the web service running inside the lightsail instance ie flask+nginx.
- To troubleshoot issues with the web service you can run the following curl command:
For testing HTTP: curl -ivso /dev/null http://<public IP of lightsail instance>
For testing HTTPS: curl -ivkLso /dev/null https://<public IP of lightsail instance>
When you run the above command if you observe a "connection refused" error then it would signify that the nginx service is not running on the TCP port 80/ TCP port 443 inside the lightsail instance. This would require to verify the nginx service configuration related to the service ports enabled.
Additionally verify if you have any access control configurations on nginx such as host name based access control where the website can be access using a specific host name only and not the IP address. If so, add the IP address to the configuration.
Hope this helps to narrow down the issue.
Relevant content
- asked 3 years ago
- AWS OFFICIALUpdated 7 months ago

Well, I try that before Evan though i open all the ports(1 to 65535) It still the same No one could connect to it.