- Start server with the default config file:nginx- Start server with a custom config file:nginx -c [config_file]- Start server with a prefix for all relative paths in the config file:nginx -c [config_file] -p [prefix/for/relative/paths]- Test the configuration without affecting the running server:nginx -t- Reload the configuration by sending a signal with no downtime:nginx -s reload
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:
-? | -h' Print help.
-g directives Set global configuration directives. See EXAMPLES for details.
-p prefix' Set prefix path. Default value is %%PREFIX%%.
-q' Suppress non-error messages during configuration testing.
-s 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.
stop' SIGTERM quit' SIGQUIT reopen' SIGUSR1 reload' SIGHUP
-t' Don't run, just test the configuration file. The nginx checks configuration for correct syntax and then tries to open files referred in configuration.
-v' Print nginx version.
-V' Print nginx version, compiler version and configure script parameters.
The master process of nginx can handle the following signals.
SIGINT, SIGTERM' Shut down quickly.
While there's 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.
To enable a debugging log, reconfigure nginx to build with debugging:
and then set the debug level of the error_log:
It is also possible to enable the debugging for some IP address:
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;"
Documentation at http://nginx.org/ and http://sysoev.ru/nginx/.
For questions and technical support, please refer to http://nginx.org/en/support.html.
Development of nginx started in 2002, with the first public release on October 4, 2004.
Igor Sysoev <firstname.lastname@example.org>
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.
BSD August 10, 2011 BSD