R
R
raft882017-06-07 13:49:44
Node.js
raft88, 2017-06-07 13:49:44

Why is one port active for all sites on the server (nodejs)?

Hello!
I'm recently learning nodejs, everything works fine on the local server. Decided to transfer to VPS (OS - Debian 7). Used commands:

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install -y build-essential

everything became successful, but now there is another problem - there are also several other WordPress sites on the server, in the end - if you add port :3000 to any site (the one that the nodejs server listens on), then they all load the same page.
Why is this happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rustler2000, 2017-06-07
@rustler2000

Because you need to bind to 127.0.0.1 and not to any.
https://nodejs.org/api/http.html#http_server_liste... - second argument should be "127.0.0.1"

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question