H
H
hbrmdc2016-04-25 17:26:11
Node.js
hbrmdc, 2016-04-25 17:26:11

How to run a second NodeJS server on a VPS subdomain?

I have a working web application on VPS
Node JS, Express, pm2
How to run a separate server that will use a subdomain of the same domain? We need a separate, not an appendage

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Shidlovsky, 2016-04-26
@hbrmdc

The matter is that for the server the sheaf IP:port is necessary.
For the http server, we need port 80 (let's forget about httpS for simplicity).
So we need either an additional IP or something that can parse the name from the URL and proxy requests. We look towards nginx or something similar.
And node.js will already live on local addresses / other ports, for example, 127.0.0.1:81 and real_ip:81
ps. When using nginx, it will be possible to immediately give statics, and a lot of other interesting things.

O
O. J, 2016-04-25
@OrlovEvgeny

Run Docker at least 50.
setting express-subdomain

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question