blob: f119a2327a85e4d034a6ed3a12387c4800bad8ed [file] [log] [blame]
Igor Sysoeve1a30b42010-11-25 14:12:31 +00001.\"
Ruslan Ermilovf3ab6ec2012-12-31 22:08:19 +00002.\" Copyright (C) 2010 Sergey A. Osokin
3.\" Copyright (C) Nginx, Inc.
Igor Sysoeve1a30b42010-11-25 14:12:31 +00004.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\" notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\" notice, this list of conditions and the following disclaimer in the
13.\" documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25.\" SUCH DAMAGE.
26.\"
27.\"
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000028.Dd March 6, 2012
Igor Sysoeve1a30b42010-11-25 14:12:31 +000029.Dt NGINX 8
30.Os
31.Sh NAME
32.Nm nginx
33.Nd "HTTP and reverse proxy server, mail proxy server"
34.Sh SYNOPSIS
35.Nm
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000036.Op Fl ?hqtVv
Igor Sysoeve1a30b42010-11-25 14:12:31 +000037.Op Fl c Ar file
38.Op Fl g Ar directives
39.Op Fl p Ar prefix
40.Op Fl s Ar signal
41.Sh DESCRIPTION
Igor Sysoeve1a30b42010-11-25 14:12:31 +000042.Nm
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000043(pronounced
Igor Sysoeve1a30b42010-11-25 14:12:31 +000044.Dq engine x )
45is an HTTP and reverse proxy server, as well as a mail proxy server.
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000046It is known for its high performance, stability, rich feature set, simple
Igor Sysoeve1a30b42010-11-25 14:12:31 +000047configuration, and low resource consumption.
48.Pp
49The options are as follows:
50.Bl -tag -width ".Fl d Ar directives"
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000051.It Fl ?\& , h
Igor Sysoeve1a30b42010-11-25 14:12:31 +000052Print help.
53.It Fl c Ar file
54Use an alternative configuration
55.Ar file .
56.It Fl g Ar directives
57Set global configuration directives.
58See
59.Sx EXAMPLES
60for details.
61.It Fl p Ar prefix
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000062Set the prefix path.
63The default value is
Igor Sysoeve1a30b42010-11-25 14:12:31 +000064.Pa %%PREFIX%% .
65.It Fl q
66Suppress non-error messages during configuration testing.
67.It Fl s Ar signal
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000068Send a signal to the master process.
Igor Sysoeve1a30b42010-11-25 14:12:31 +000069The argument
70.Ar signal
71can be one of:
72.Cm stop , quit , reopen , reload .
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000073The following table shows the corresponding system signals:
Igor Sysoeve1a30b42010-11-25 14:12:31 +000074.Pp
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000075.Bl -tag -width ".Cm reopen" -compact
Igor Sysoeve1a30b42010-11-25 14:12:31 +000076.It Cm stop
77.Dv SIGTERM
78.It Cm quit
79.Dv SIGQUIT
80.It Cm reopen
81.Dv SIGUSR1
82.It Cm reload
83.Dv SIGHUP
84.El
85.It Fl t
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000086Do not run, just test the configuration file.
Igor Sysoeve1a30b42010-11-25 14:12:31 +000087.Nm
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000088checks the configuration file syntax and then tries to open files
89referenced in the configuration file.
Igor Sysoeve1a30b42010-11-25 14:12:31 +000090.It Fl V
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000091Print the
Igor Sysoeve1a30b42010-11-25 14:12:31 +000092.Nm
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000093version, compiler version, and
Igor Sysoeve1a30b42010-11-25 14:12:31 +000094.Pa configure
95script parameters.
Ruslan Ermilov098c7b62012-03-06 06:54:48 +000096.It Fl v
97Print the
98.Nm
99version.
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000100.El
101.Sh SIGNALS
102The master process of
103.Nm
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000104can handle the following signals:
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000105.Pp
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000106.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000107.It Dv SIGINT , SIGTERM
108Shut down quickly.
109.It Dv SIGHUP
110Reload configuration, start the new worker process with a new
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000111configuration, and gracefully shut down old worker processes.
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000112.It Dv SIGQUIT
113Shut down gracefully.
114.It Dv SIGUSR1
115Reopen log files.
116.It Dv SIGUSR2
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000117Upgrade the
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000118.Nm
119executable on the fly.
120.It Dv SIGWINCH
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000121Shut down worker processes gracefully.
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000122.El
123.Pp
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000124While there is no need to explicitly control worker processes normally,
125they support some signals too:
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000126.Pp
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000127.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000128.It Dv SIGTERM
129Shut down quickly.
130.It Dv SIGQUIT
131Shut down gracefully.
132.It Dv SIGUSR1
133Reopen log files.
134.El
135.Sh DEBUGGING LOG
136To enable a debugging log, reconfigure
137.Nm
138to build with debugging:
139.Pp
140.Dl "./configure --with-debug ..."
141.Pp
142and then set the
143.Cm debug
144level of the
145.Va error_log :
146.Pp
147.Dl "error_log /path/to/log debug;"
148.Pp
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000149It is also possible to enable the debugging for a particular IP address:
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000150.Bd -literal -offset indent
151events {
152 debug_connection 127.0.0.1;
153}
154.Ed
Ruslan Ermilov51e926f2012-03-12 12:29:56 +0000155.Sh ENVIRONMENT
156The
157.Ev NGINX
158environment variable is used internally by
159.Nm
160and should not be set directly by the user.
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000161.Sh FILES
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000162.Bl -tag -width indent
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000163.It Pa %%PID_PATH%%
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000164Contains the process ID of
165.Nm .
166The contents of this file are not sensitive, so it can be world-readable.
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000167.It Pa %%CONF_PATH%%
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000168The main configuration file.
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000169.It Pa %%ERROR_LOG_PATH%%
170Error log file.
171.El
172.Sh EXIT STATUS
173Exit status is 0 on success, or 1 if the command fails.
174.Sh EXAMPLES
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000175Test configuration file
176.Pa ~/mynginx.conf
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000177with global directives for PID and quantity of worker processes:
178.Bd -literal -offset indent
179nginx -t -c ~/mynginx.conf \e
180 -g "pid /var/run/mynginx.pid; worker_processes 2;"
181.Ed
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000182.Sh SEE ALSO
Ruslan Ermilovf46eafd2011-08-10 12:30:19 +0000183.\"Xr nginx.conf 5
184.\"Pp
185Documentation at
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000186.Pa http://nginx.org/en/docs/ .
Ruslan Ermilovf46eafd2011-08-10 12:30:19 +0000187.Pp
188For questions and technical support, please refer to
189.Pa http://nginx.org/en/support.html .
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000190.Sh HISTORY
191Development of
192.Nm
Igor Sysoev11156c62010-11-29 15:21:24 +0000193started in 2002, with the first public release on October 4, 2004.
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000194.Sh AUTHORS
Ruslan Ermilovf46eafd2011-08-10 12:30:19 +0000195.An -nosplit
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000196.An Igor Sysoev Aq igor@sysoev.ru .
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000197.Pp
Ruslan Ermilov51e926f2012-03-12 12:29:56 +0000198This manual page was originally written by
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000199.An Sergey A. Osokin Aq osa@FreeBSD.org.ru
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000200as a result of compiling many
Igor Sysoeve1a30b42010-11-25 14:12:31 +0000201.Nm
Ruslan Ermilov098c7b62012-03-06 06:54:48 +0000202documents from all over the world.