Starting, Stopping, and Reloading Configuration
To start nginx, run the executable file. Once
nginx is started, it can be controlled by
invoking the executable with the -s parameter.
Use the following syntax:
nginx -s signal
Where signal may be one of the following:
- stop — fast shutdown
- quit — graceful shutdown
- reload — reloading the configuration file
- reopen — reopening the log files
Changes made in the configuration file will not
be applied until the command to reload
configuration is sent to nginx or it is
restarted. To reload configuration, execute:
nginx -s reload
The process ID of the nginx master process is
written, by default, to the nginx.pid in the
directory /usr/local/nginx/logs
or /var/run
.
For example, if the master process ID is 1628, to
send the QUIT signal resulting in nginx’s
graceful shutdown, execute:
kill -s QUIT 1628
For getting the list of all running nginx
processes, the ps utility may be used, for
example, in the following way:
ps -ax | grep nginx