Rohith
Rohith

Reputation: 43

NodeJs App in AWS using port 3000 is not accessible from Internet

I am using free tier AWS Linux instance, I had installed NodeJs and started my Express JS app (sudo node bin/www) my app is running on port 3000.

When I ssh to the instance and do cURL my app is responding but not from Chrome using Instance Public IP.

I have added Ports 80, 22, 3000 in Security Groups to access the app from anywhere. [Attached ScreenShot] The instance is running in N. Virginia region.

Following are the cases I tried to make it work:

All the above cases failed, when I ssh to the instance and do cURL my app is responding.

Could someone give me more insights on this? or I am missing anything. I have been blocked by this.

I am able to access app when I set the port to 80 but I need to use port 3000 because I am running Frontend Framework on port 80.

Softwares install on the server using yum:

AWS Security Group Screenshot

P.S: I have read all the StackOverflow questions regarding the app not accessible from the internet, but in my case, my app is accessible from port 80 not from 3000.

Upvotes: 3

Views: 5758

Answers (3)

user2848810
user2848810

Reputation: 1225

3 days wasted on this. You need to disable the internal firewall. I am on a centos 7:

sudo systemctl disable firewalld sudo systemctl stop firewalld

Upvotes: 2

Lucas Hendren
Lucas Hendren

Reputation: 2826

have you allowed CORS/origions?

var allowedOrigins = [origionDomain] 
res.header('Access-Control-Allow-Origin', allowedOrigins)

Upvotes: 0

Andrei Socaciu
Andrei Socaciu

Reputation: 1198

It could be that you are trying to reach your application from a network in which outbound connections on port 3000 are blocked. Most corporate network only allow some specific kinds of traffic to leave the network, usually http(s) and such. Try testing it from another network, or from an ec2-host within a different region.

Upvotes: 3

Related Questions