Table of Contents

About

The nginx command line binary file

Syntax

nginx -h
nginx version: nginx/1.16.1
Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives]

Options:
  -?,-h         : this help
  -v            : show version and exit
  -V            : show version and configure options then exit
  -t            : test configuration and exit
  -T            : test configuration, dump it and exit
  -q            : suppress non-error messages during configuration testing
  -s signal     : send signal to a master process: stop, quit, reopen, reload
  -p prefix     : set prefix path (default: /usr/share/nginx/)
  -c filename   : set configuration file (default: /etc/nginx/nginx.conf)
  -g directives : set global directives out of configuration file

Example

nginx -t # configuration test
nginx -s reload # reload configuration 
nginx -s reopen # reopen log files
nginx -s quit # quit - It should be executed under the same user that started nginx.
# equivalent to where 1628 is a fake PID (process id)
kill -s QUIT 1628
nginx -v # version
nginx version: nginx/1.16.1