Scroll to navigation

NGINX(8) System Manager's Manual NGINX(8)


nginxHTTP and reverse proxy server, mail proxy server


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


nginx (pronounced “engine x”) is an HTTP and reverse proxy server, a mail proxy server, and a generic TCP/UDP 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.
Use an alternative configuration file.
Use an alternative error log file. Special value stderr indicates that the standard error output should be used.
Set global configuration directives. See EXAMPLES for details.
Set the prefix path. The default value is /usr/share/nginx.
Suppress non-error messages during configuration testing.
Send a signal to the master process. The argument signal can be one of: stop, quit, reopen, reload. The following table shows the corresponding system signals:

Same as -t, but additionally dump configuration files to standard output.
Do not run, just test the configuration file. nginx checks the configuration file syntax and then tries to open files referenced in the configuration file.
Print the nginx version, compiler version, and configure script parameters.
Print the nginx version.


The master process of nginx can handle the following signals:

Shut down quickly.
Reload configuration, start the new worker process with a new configuration, and gracefully shut down old worker processes.
Shut down gracefully.
Reopen log files.
Upgrade the nginx executable on the fly.
Shut down worker processes gracefully.

While there is no need to explicitly control worker processes normally, they support some signals too:

Shut down quickly.
Shut down gracefully.
Reopen log files.


To 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 {


The NGINX environment variable is used internally by nginx and should not be set directly by the user.


Contains the process ID of nginx. The contents of this file are not sensitive, so it can be world-readable.
The main configuration file.
Error log file.


Exit status is 0 on success, or 1 if the command fails.


Test configuration file ~/mynginx.conf with global directives for PID and quantity of worker processes:

nginx -t -c ~/mynginx.conf \
	-g "pid /var/run/; worker_processes 2;"


Documentation at

For questions and technical support, please refer to


Development of nginx started in 2002, with the first public release on October 4, 2004.


Igor Sysoev <>.

This manual page was originally written by Sergey A. Osokin <> as a result of compiling many nginx documents from all over the world.

November 5, 2020 Debian