M
M
massef2019-12-03 17:11:28
Node.js
massef, 2019-12-03 17:11:28

How to create dynamic subdomains in node.js?

There is a project on the MEVN stack (mongo, express, vue, node) It was
necessary to create a subdomain for the user. For example namecompany.site.ru.
The name of the company (subdomain) is entered in the user's admin panel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2019-12-03
@firedragon

Configure nginx
A special name with a mask like “.example.org” matches both the exact name “example.org” and the mask “*.example.org”.
https://nginx.org/ru/docs/http/server_names.html
Add logic to your engine to handle subdomains.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question