A
A
a_donov2018-11-29 15:16:43
Nginx
a_donov, 2018-11-29 15:16:43

How to host 1000 sites on one nginx server?

There is a website builder. Each site is on its own domain.
In the database, each site is represented by several rows in different tables.
Nginx is optimized, it almost does not feel the load. There is essentially nothing on the server, the database is almost empty.
When the mark of 300 sites is overcome, nginx reboots within 10 seconds, because there are 300 configuration files in sites_enabled. And the more, the longer.
How can the logic of sites_enabled be revised?
server_name _ don't want to use, it's stupid and unsafe.
Can create balancers with a list of domains and proxy requests to the server from the database?
Are there any other options?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-11-29
@a_donov

https://serverfault.com/questions/378581/nginx-con...
nginx.org/en/docs/switches.html
reload — reload configuration, start the new worker process with a new configuration, gracefully shut down old worker processes .
DRY does not apply to configs, as Uncle Igor said https://events.yandex.ru/lib/talks/2392/
The maximum that is required is to make a template and substitute values ​​there and insert the result into the config

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question