Command-line parameters
nginx supports the following command-line parameters:
-
-?
|-h
— print help for command-line parameters. -
-c
— use an alternative configurationfile
file
instead of a default file. -
-g
— set global configuration directives, for example,directives
nginx -g "pid /var/run/nginx.pid; worker_processes `sysctl -n hw.ncpu`;"
-
-p
— set nginx path prefix, i.e. a directory that will keep server files (default value isprefix
/usr/local/nginx
). -
-q
— suppress non-error messages during configuration testing. -
-s
— send a signal to the master process. The argument signal can be one of:signal
-
stop
— shut down quickly -
quit
— shut down gracefully -
reload
— reload configuration, start the new worker process with a new configuration, gracefully shut down old worker processes. -
reopen
— reopen log files
-
-
-t
— test the configuration file: nginx checks the configuration for correct syntax, and then tries to open files referred in the configuration. -
-T
— same as-t
, but additionally dump configuration files to standard output (1.9.2). -
-v
— print nginx version. -
-V
— print nginx version, compiler version, and configure parameters.