A
A
Artur Aralin2015-07-11 23:38:19
Domain Name System
Artur Aralin, 2015-07-11 23:38:19

How to change listening port from 80 to arbitrary?

Greetings! I have such a situation, there is a server running on node.js and you need to connect 2 domains to it, and therefore you need to listen on different ports or is it organized somehow differently? Tell me please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
OnYourLips, 2015-07-12
@ArturAralin

and you need to connect 2 domains to it, and therefore wiretapping needs to be done on different ports, or is it organized somehow differently

Somehow differently.
Stupid wrong decision: depending on the domain, just serve different content.
The right solution: nginx, which your applications will run behind.

T
Timur Shemsedinov, 2015-07-11
@MarcusAurelius

Check the req.url field, parse it, take a domain name from it, and you can make at least 100 sites on one port. Or reverse proxy on several ports: nginx, haproxy.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question