Linux "nginx" Command Line Options and Examples
"HTTP and reverse proxy server, mail proxy server"

nginx (pronounced “engine x”) is an HTTP and reverse proxy server, as well as a mail proxy server. It is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption. The options are as follows: -?, -h Print help.


nginx [-?hqTtVv] [-c file] [-g directives] [-p prefix] [-s signal]

Command Line Options:

-h Print help.
nginx -? ...
file Use an alternative configuration file.
nginx -c ...
directives Set global configuration directives. See EXAMPLES for details.
nginx -g ...
prefix Set the prefix path. The default value is /usr/share/nginx.
nginx -p ...
Suppress non-error messages during configuration testing.
nginx -q ...
but additionally dump configuration files to standard output.
nginx -T ...
Print the nginx version, compiler version, and configure script parameters.
nginx -V ...
SIGNALSThe master process of nginx can handle the following signals:SIGINT, SIGTERM Shut down quickly.SIGHUP Reload configuration, start the new worker process with a new configuration, and gracefullyshut down old worker processes.SIGQUIT Shut down gracefully.SIGUSR1 Reopen log files.SIGUSR2 Upgrade the nginx executable on the fly.SIGWINCH Shut down worker processes gracefully.While there is no need to explicitly control worker processes normally, they support some signals too:SIGTERM Shut down quickly.SIGQUIT Shut down gracefully.SIGUSR1 Reopen log files.DEBUGGING LOGTo enable a debugging log, reconfigure nginx to build with debugging:./configure --with-debug ...and then set the debug level of the error_log:error_log /path/to/log debug;It is also possible to enable the debugging for a particular IP address:events {debug_connection;}ENVIRONMENTThe NGINX environment variable is used internally by nginx and should not be set directly by the user.FILES/run/nginx.pidContains the process ID of nginx. The contents of this file are not sensitive, so it can be world-read‐able./etc/nginx/nginx.confThe main configuration file./var/log/nginx/error.logError log file.EXIT STATUSExit status is 0 on success, or 1 if the command fails.EXAMPLESTest configuration file ~/mynginx.conf with global directives for PID and quantity of worker processes:nginx -t -c ~/mynginx.conf \
nginx -v ...