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

nginx
HTTP and reverse proxy server, mail proxy server

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

The nginx (spelled “engine x”) is an HTTP and reverse proxy server, as well as a mail proxy server. The nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

The options are as follows:

|
Print help.
file
Use an alternative configuration file.
directives
Set global configuration directives. See EXAMPLES for details.
prefix
Set prefix path. Default value is %%PREFIX%%.
Suppress non-error messages during configuration testing.
signal
Send signal to the master process. The argument signal can be one of: stop, quit, reopen, reload. The following table shows the corresponding system signals.

Don't run, just test the configuration file. The nginx checks configuration for correct syntax and then tries to open files referred in configuration.
Print nginx version.
Print nginx version, compiler version and configure script parameters.

The master process of nginx can handle the following signals.

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

While there's 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 some IP address:

events {
	debug_connection 127.0.0.1;
}

%%PID_PATH%%
Contains the process ID of the nginx listening for connections. The content of this file is not sensitive; it can be world-readable.
%%CONF_PATH%%
Main configuration file.
%%ERROR_LOG_PATH%%
Error log file.

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

nginx -t -c ~/mynginx.conf -g "pid /var/run/mynginx.pid; worker_processes 2;"
Test configuration file ~/mynginx.conf with global directives for PID and quantity of worker processes.

nginx.conf(5)

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

Igor Sysoev ⟨igor@sysoev.ru⟩

Documentation available on http://nginx.org/ and http://sysoev.ru/nginx/.

This manual page was written by
Sergey A. Osokin ⟨osa@FreeBSD.org.ru⟩ as a result of compilation of many nginx documents all over the world.

Report to mailing list ⟨nginx@nginx.org⟩ if you found one.
November 14, 2010 BSD