1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
.\" $OpenBSD: nginx.8,v 1.7 2012/08/15 19:25:41 jmc Exp $
.\"
.\" Copyright (c) 2010 Sergey A. Osokin
.\" Copyright (c) 2011,2012 Nginx, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"
.Dd $Mdocdate: August 15 2012 $
.Dt NGINX 8
.Os
.Sh NAME
.Nm nginx
.Nd HTTP and reverse proxy server, mail proxy server
.Sh SYNOPSIS
.Nm
.Op Fl ?hqtuVv
.Op Fl c Ar file
.Op Fl g Ar directives
.Op Fl p Ar prefix
.Op Fl s Ar signal
.Sh DESCRIPTION
.Nm
(pronounced
.Dq 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.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl ?\& | h
Print help.
.It Fl c Ar file
Use an alternative configuration
.Ar file .
.It Fl g Ar directives
Set global configuration directives.
See
.Sx EXAMPLES
for details.
.It Fl p Ar prefix
Set the prefix path.
The default value is
.Pa %%PREFIX%% .
.It Fl q
Suppress non-error messages during configuration testing.
.It Fl s Ar signal
Send a signal to the master process.
The argument
.Ar signal
can be one of:
.Cm stop , quit , reopen , reload .
The following table shows the corresponding system signals.
.Pp
.Bl -tag -width ".It Cm reopen" -offset indent -compact
.It Cm stop
.Dv SIGTERM
.It Cm quit
.Dv SIGQUIT
.It Cm reopen
.Dv SIGUSR1
.It Cm reload
.Dv SIGHUP
.El
.It Fl t
Don't run, just test the configuration file.
.Nm
checks the configuration file syntax and then tries to open any files
referred to in the configuration file.
.It Fl u
By default
.Nm
will
.Xr chroot 2
to the home directory of the user running the daemon,
typically
.Dq www ,
or to the home directory of
.Ic user
in
.Pa nginx.conf .
The
.Fl u
option disables this behaviour, and returns
.Nm
to the original "unsecure" behaviour.
.It Fl V
Print the
.Nm
version, compiler version, and
.Pa configure
script parameters.
.It Fl v
Print the
.Nm
version.
.El
.Pp
The master process of
.Nm
can handle the following signals.
.Pp
.Bl -tag -width ".It Dv SIGINT , SIGTERM" -compact
.It Dv SIGINT , SIGTERM
Shut down quickly.
.It Dv SIGHUP
Reload configuration, start the new worker process with a new
configuration, and gracefully shut down old worker processes.
.It Dv SIGQUIT
Shut down gracefully.
.It Dv SIGUSR1
Reopen log files.
.It Dv SIGUSR2
Upgrade the
.Nm
executable on the fly.
.It Dv SIGWINCH
Shut down worker processes gracefully.
.El
.Pp
While there's no need to explicitly control worker processes normally,
they support some signals too:
.Pp
.Bl -tag -width ".It Dv SIGINT , SIGTERM" -compact
.It Dv SIGTERM
Shut down quickly.
.It Dv SIGQUIT
Shut down gracefully.
.It Dv SIGUSR1
Reopen log files.
.El
.Sh DEBUGGING LOG
To enable a debugging log, reconfigure
.Nm
to build with debugging:
.Pp
.Dl "./configure --with-debug ..."
.Pp
and then set the
.Cm debug
level of the
.Va error_log :
.Pp
.Dl "error_log /path/to/log debug;"
.Pp
It is also possible to enable the debugging for a particular IP address:
.Bd -literal -offset indent
events {
debug_connection 127.0.0.1;
}
.Ed
.Sh FILES
.Bl -tag -width indent -compact
.It Pa %%PID_PATH%%
Contains the process ID of
.Nm .
The contents of this file are not sensitive, so it can be world-readable.
.It Pa %%CONF_PATH%%
The main configuration file.
.It Pa %%ERROR_LOG_PATH%%
Error log file.
.El
.Sh EXIT STATUS
.Ex -std nginx
.Sh EXAMPLES
Test configuration file
.Pa ~/mynginx.conf
with global directives for PID and quantity of worker processes:
.Bd -literal -offset indent
nginx -t -c ~/mynginx.conf \e
-g "pid /var/run/mynginx.pid; worker_processes 2;"
.Ed
.Sh SEE ALSO
.\"Xr nginx.conf 5
.\"Pp
Documentation at
.Lk http://nginx.org/en/docs/ .
.Pp
For questions and technical support, please refer to
.Lk http://nginx.org/en/support.html .
.Sh HISTORY
Development of
.Nm
started in 2002, with the first public release on October 4, 2004.
.Sh AUTHORS
.An -nosplit
.An Igor Sysoev Aq igor@sysoev.ru .
.Pp
This manual page was written by
.An Sergey A. Osokin Aq osa@FreeBSD.org.ru
as a result of compiling many
.Nm
documents from all over the world.
|