Is there any way to configure nginx (or other quick reverse proxy) dynamically?

后端 未结 8 1873
旧巷少年郎
旧巷少年郎 2021-02-04 02:12

Suppose we have several identical nodes which are the application servers of some n-tier service. And suppose we use Apache ZooKeeper to keep all the config\'s of our distribute

8条回答
  •  暖寄归人
    2021-02-04 02:55

    Nginx has two methods of changing configuration:

    • HUP signal to the master process results in "reload". Nginx starts a bunch of new workers and lets the old workers to shutdown gracefully, i.e. they finish existing requests. There is no interruption of service. This method of configuration change is very lightweight and quick, but has few limitations: you cannot change cache zones or re-compile Perl scripts.

    • USR2 signal, then WINCH and then QUIT to the master process result in "executable upgrade" and this sequence lets completely re-read whole configuration and even upgrade the Nginx executable. It reloads disk caches as well (which maybe time consuming). This method results in no interruption of service too.

    Official documentation

提交回复
热议问题