I
I
Ivan Kozlov2015-12-28 08:18:31
Domain name market
Ivan Kozlov, 2015-12-28 08:18:31

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

2 answer(s)
D
Dmitry Gusev, 2015-12-28
@illi

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.

A
Alexander Litvinenko, 2015-12-28
@edli007

https://www.npmjs.com/search?q=subdomain

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question