Answer the question
In order to leave comments, you need to log in
How to run 1 node.js app on multiple subdomains?
There is a site (application) written on node.js. Works. The site is hosted on vds. The server is configured.
The task consists in the following:
There is a site.ru domain.
I need to create several subdomains with cities like moscow.site.ru, stpeterburg.site.ru, nsk.site.ru, etc. These are just examples. So it is necessary that the same application be launched on all subdomains (not copies, but one).
Purpose: On the site, depending on the city, there will be an initial issue of material for this particular city.
Answer the question
In order to leave comments, you need to log in
You can set up all subdomains and domains on one of your servers, and in the application code, through req.host, look from which domain / subdomain the request is coming from, and give the necessary content.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question