I have a NodeJs/Express project in Alibaba cloud based Ubuntu server.

When I run project and access with curl localhost:3000 and curl 127.0.0.1:3000 it works!

When I access with IP public, e.g. curl 192.x.x.x:3000 it doesn't work, even though I have edited config in Express project in some code to : server.listen(3000,"0.0.0.0") OR server.listen("3000","192.x.x.x").

FYI I have Apache on this server. When I access on Internet with IP public no problem. What can I do to solve this problem? Thanks beforehand.

PS: the 192.x.x.x is my IP public and it works access with Apache project

2 Answers

0
Janith Kasun On Best Solutions

You have to configure your security ground and create a inbound rule to allow port 3000. Follow this guideline.

https://www.alibabacloud.com/help/doc-detail/25471.htm

Make sure you allow TCP traffic or all traffic from all sources to the port 3000 as the inbound rule.

0
Charlie H On

The fact that you can access your service locally - but not publicly could mean 2 possible configurations:

  1. The server running your application has blocked the port 3000

  2. You have not configured your server to map the port 80 of a specific route to the port 3000

It is highly possible that a most essential part of your server configuration has not been done.