user3396381
user3396381

Reputation: 93

how to nginx configuration updates without having to reload or restart nginx

I want Nginx to update configuration file without reloading or restarting Nginx. It seem API or anything (http://nginx.com/products/on-the-fly-reconfiguration/).

Upvotes: 9

Views: 13273

Answers (1)

Brandon - Free Palestine
Brandon - Free Palestine

Reputation: 16666

On Ubuntu or Debian it's as simple as using the reload argument:

service nginx reload

The official way is to send SIGHUP:

kill -HUP $(ps -ef | grep nginx | grep master | awk '{print $2}')

The above command will get the process ID of the nginx master process and send a SIGHUP signal to it.

See the Controlling Nginx documentation for Nginx.

You can also use the Nginx binary:

nginx -s reload

Upvotes: 16

Related Questions