I
I
Ivan Chernyshev2017-05-04 18:47:38
Nginx
Ivan Chernyshev, 2017-05-04 18:47:38

How to run two NodeJS webservers on the same port?

Hello.
There are two different web servers written in NodeJS. It is clear that both should listen to port 80.
How to make it so that when mysite1.com is requested , one server is responsible for issuing statics, and when mysite2.com is requested, another, and all this in parallel?
There is a suspicion that nginx must somehow cope with this task, but I could not figure out how.
Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Leonid Knyazev, 2017-05-04
@IvanBlacky

Run nodejs applications on different ports, and put nginx in front of them on port 80, which, depending on the domain, will already determine which application to send a request to.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question