L
L
lolka022019-07-29 13:55:09
Nginx
lolka02, 2019-07-29 13:55:09

How to set up a server for dynamic domains?

The task is to make dynamic sites, such as a site builder
, there are ready-made templates, the user selects for his site, the files are conditionally /var/www/site.com
all sites added by users are stored in the table site {id, domain, created_at, template_id}
as when accessing to the domain that is stored in the site table open /var/www/site.com?
the nginx+php-fpm bundle is configured on the server. How to make dynamic domains in nginx?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Fedoseev, 2019-07-29
@martin74ua

you need to generate the necessary configuration for nginx based on information from the database. Approximately what all hosting control panels do.

D
Dmitry, 2019-07-29
@q2digger

And if you want "stylish, fashionable, youthful", then you can use consul + consul template. generating configs for anything, especially for nginx on the fly - this bunch's favorite thing to do.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question