I use nginx as a reverse proxy. Whenever I update the config for it using
sudo "cp -r #{nginx_config_path}* /etc/nginx/sites-enabled/"
sudo "kill -s HUP `cat /var/run/nginx.pid`"
I face a brief downtime. How can I avoid that?
|
I use nginx as a reverse proxy. Whenever I update the config for it using
I face a brief downtime. How can I avoid that? |
|||
|
|
Run It will do a hot reload of the configuration without downtime. If you have pending requests, then there will be lingering nginx processes that will handle those connections before it does, so it's an extremely graceful way to reload configs. |
|||
|
|
Usually, reloading configuration file of a service should not affect the running service. However, this depends on how the If a specific service is experiencing a downtime during reload, this can be circumvented by running the same service on multiple servers preferably using a load balancer. In this case, you can take out one server at a time and reload/restart it. Then, it can be re-added after confirming it is OK. |
|||||
|