xref: /f-stack/app/nginx-1.16.1/man/nginx.8 (revision 3da8d17d)
1.\"
2.\" Copyright (C) 2010 Sergey A. Osokin
3.\" Copyright (C) Nginx, Inc.
4.\" 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.\"
28.Dd June 16, 2015
29.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
36.Op Fl ?hqTtVv
37.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
42.Nm
43(pronounced
44.Dq engine x )
45is an HTTP and reverse proxy server, as well as a mail proxy server.
46It is known for its high performance, stability, rich feature set, simple
47configuration, and low resource consumption.
48.Pp
49The options are as follows:
50.Bl -tag -width ".Fl d Ar directives"
51.It Fl ?\& , h
52Print 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
62Set the prefix path.
63The default value is
64.Pa %%PREFIX%% .
65.It Fl q
66Suppress non-error messages during configuration testing.
67.It Fl s Ar signal
68Send a signal to the master process.
69The argument
70.Ar signal
71can be one of:
72.Cm stop , quit , reopen , reload .
73The following table shows the corresponding system signals:
74.Pp
75.Bl -tag -width ".Cm reopen" -compact
76.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
86Do not run, just test the configuration file.
87.Nm
88checks the configuration file syntax and then tries to open files
89referenced in the configuration file.
90.It Fl T
91Same as
92.Fl t ,
93but additionally dump configuration files to standard output.
94.It Fl V
95Print the
96.Nm
97version, compiler version, and
98.Pa configure
99script parameters.
100.It Fl v
101Print the
102.Nm
103version.
104.El
105.Sh SIGNALS
106The master process of
107.Nm
108can handle the following signals:
109.Pp
110.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
111.It Dv SIGINT , SIGTERM
112Shut down quickly.
113.It Dv SIGHUP
114Reload configuration, start the new worker process with a new
115configuration, and gracefully shut down old worker processes.
116.It Dv SIGQUIT
117Shut down gracefully.
118.It Dv SIGUSR1
119Reopen log files.
120.It Dv SIGUSR2
121Upgrade the
122.Nm
123executable on the fly.
124.It Dv SIGWINCH
125Shut down worker processes gracefully.
126.El
127.Pp
128While there is no need to explicitly control worker processes normally,
129they support some signals too:
130.Pp
131.Bl -tag -width ".Dv SIGINT , SIGTERM" -compact
132.It Dv SIGTERM
133Shut down quickly.
134.It Dv SIGQUIT
135Shut down gracefully.
136.It Dv SIGUSR1
137Reopen log files.
138.El
139.Sh DEBUGGING LOG
140To enable a debugging log, reconfigure
141.Nm
142to build with debugging:
143.Pp
144.Dl "./configure --with-debug ..."
145.Pp
146and then set the
147.Cm debug
148level of the
149.Va error_log :
150.Pp
151.Dl "error_log /path/to/log debug;"
152.Pp
153It is also possible to enable the debugging for a particular IP address:
154.Bd -literal -offset indent
155events {
156	debug_connection 127.0.0.1;
157}
158.Ed
159.Sh ENVIRONMENT
160The
161.Ev NGINX
162environment variable is used internally by
163.Nm
164and should not be set directly by the user.
165.Sh FILES
166.Bl -tag -width indent
167.It Pa %%PID_PATH%%
168Contains the process ID of
169.Nm .
170The contents of this file are not sensitive, so it can be world-readable.
171.It Pa %%CONF_PATH%%
172The main configuration file.
173.It Pa %%ERROR_LOG_PATH%%
174Error log file.
175.El
176.Sh EXIT STATUS
177Exit status is 0 on success, or 1 if the command fails.
178.Sh EXAMPLES
179Test configuration file
180.Pa ~/mynginx.conf
181with global directives for PID and quantity of worker processes:
182.Bd -literal -offset indent
183nginx -t -c ~/mynginx.conf \e
184	-g "pid /var/run/mynginx.pid; worker_processes 2;"
185.Ed
186.Sh SEE ALSO
187.\"Xr nginx.conf 5
188.\"Pp
189Documentation at
190.Pa http://nginx.org/en/docs/ .
191.Pp
192For questions and technical support, please refer to
193.Pa http://nginx.org/en/support.html .
194.Sh HISTORY
195Development of
196.Nm
197started in 2002, with the first public release on October 4, 2004.
198.Sh AUTHORS
199.An -nosplit
200.An Igor Sysoev Aq [email protected] .
201.Pp
202This manual page was originally written by
203.An Sergey A. Osokin Aq [email protected]
204as a result of compiling many
205.Nm
206documents from all over the world.
207