Mayur_28
Mayur_28

Reputation: 1

EC2 instance refused to connect

I have a site built on NodeJS, which I am currently trying to deploy on the free tier on AWS.

So far I have created an instance, launched it, I can connect via SSH (console) to my instance, and have successfully pulled my files from my Git repository. However, when I try to browse my public DNS, I get: http://ec2-13-234-136-30.ap-south-1.compute.amazonaws.com:2222 took too long to respond.

I have also had a look at the settings on security group (as recommended on a different post) and ensured that inbound and outbound 'HTTP' and 'HTTPS' traffic are allowed (screenshot below):

Inbound settings: Inbound settings

inbound rules image

Outbound settings: enter image description here

Any ideas on what else could be causing this issue? I would greatly appreciate your help. Thanks.

Upvotes: 0

Views: 347

Answers (1)

duyvh
duyvh

Reputation: 494

Your security configuration is too permissive, please limit to the port and protocols you are using.

Given that your firewall is off, which you should definitely check to confirm, I guess you start NodeJs server binding to hostname 127.0.0.1, which allows only local traffics from EC2 instance.

Try changing it to 0.0.0.0, which allows public traffic and see if that solves your problem.

Upvotes: 2

Related Questions