I have created amazon EC2 instance and able to SSH also using below command
ssh -i Ec2CHD5.pem [email protected]
When I try to ping c2-xx-xx-xxx-xxx.ap-southeast-1.compute.amazonaws.com
I am able to do so also.
But when try to curl curl http://c2-xx-xx-xxx-xxx.ap-southeast-1.compute.amazonaws.com
I am getting connection refused,
am I missing any step or guidelines?
Could somebody guide me to troubleshoot.
Probably your server running on the aws instance is only listening to localhost or 127.0.0.1, thus it will ignore connections from the outside. try listening to 0.0.0.0
In my case the problem was not in aws, but in the http service I started. My http service was a node express app. In the listen command I had to pass '0.0.0.0' as the listening server, NOT '127.0.0.1'
http.createServer( .... ).listen(80, '0.0.0.0');
On aws side, this is the usual checklist :
For these three steps on aws side, you can refer this page : https://aws.amazon.com/premiumsupport/knowledge-center/instance-vpc-troubleshoot/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With