Article From:https://segmentfault.com/q/1010000009603031
Question:

nodejsNovice, bought an Ali cloud server with the lowest matching. I want to deploy my own nodejs project, and the node version is 6.10.0.
But it’s wrong to start.
Port number: 3000
ipIt’s Ali cloud’s public network IP.

Port usage 3000 was not used:

Baidu has done many things but can not solve it. Seek the bull’s advice.
The code is as follows:

Answer 0:

It is not possible to access the node server directly from the public network address of the lowest allocation server bought by oneself. It is recommended that the nginx proxy localhost be reused.
Ali cloud official explanation.

Or change the hostname to: 127.0.0.1 and then visit the public network address.
Reference: http://www.jianshu.com/p/0c8c…

Answer 1:

hostnameThe router IP cannot be specified. IP or 0.0.0.0 can only be specified as NIC.

Answer 2:

Remove hostname, app.listen method.

Do you specify listen on this network card?

So, ifconfig determines that this IP is the IP of a local NIC.

Leave a Reply

Your email address will not be published. Required fields are marked *