Mercurial > hg > nginx
annotate docs/man/nginx.8 @ 7884:b87b7092cedb
Improved logging of invalid headers.
In 71edd9192f24 logging of invalid headers which were rejected with the
NGX_HTTP_PARSE_INVALID_HEADER error was restricted to just the "client
sent invalid header line" message, without any attempts to log the header
itself.
This patch returns logging of the header up to the invalid character and
the character itself. The r->header_end pointer is now properly set
in all cases to make logging possible.
The same logging is also introduced when parsing headers from upstream
servers.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 28 Jun 2021 18:01:20 +0300 |
parents | f57a478aa16d |
children | 985b0bda403c |
rev | line source |
---|---|
3788 | 1 .\" |
7608
4718a646187a
Update manpage, sort command line options.
Sergey A. Osokin <osa@FreeBSD.org.ru>
parents:
6189
diff
changeset
|
2 .\" Copyright (C) 2010, 2019 Sergey A. Osokin |
5000 | 3 .\" Copyright (C) Nginx, Inc. |
3788 | 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 .\" | |
7744
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
7608
diff
changeset
|
28 .Dd November 5, 2020 |
3788 | 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 | |
6188
f08e80409dfd
Documentation: added -T option description to the man page.
Vladimir Homutov <vl@nginx.com>
parents:
5000
diff
changeset
|
36 .Op Fl ?hqTtVv |
3788 | 37 .Op Fl c Ar file |
7744
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
7608
diff
changeset
|
38 .Op Fl e Ar file |
3788 | 39 .Op Fl g Ar directives |
40 .Op Fl p Ar prefix | |
41 .Op Fl s Ar signal | |
42 .Sh DESCRIPTION | |
43 .Nm | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
44 (pronounced |
3788 | 45 .Dq engine x ) |
7608
4718a646187a
Update manpage, sort command line options.
Sergey A. Osokin <osa@FreeBSD.org.ru>
parents:
6189
diff
changeset
|
46 is an HTTP and reverse proxy server, a mail proxy server, and a generic |
4718a646187a
Update manpage, sort command line options.
Sergey A. Osokin <osa@FreeBSD.org.ru>
parents:
6189
diff
changeset
|
47 TCP/UDP proxy server. |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
48 It is known for its high performance, stability, rich feature set, simple |
3788 | 49 configuration, and low resource consumption. |
50 .Pp | |
51 The options are as follows: | |
52 .Bl -tag -width ".Fl d Ar directives" | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
53 .It Fl ?\& , h |
3788 | 54 Print help. |
55 .It Fl c Ar file | |
56 Use an alternative configuration | |
57 .Ar file . | |
7744
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
7608
diff
changeset
|
58 .It Fl e Ar file |
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
7608
diff
changeset
|
59 Use an alternative error log |
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
7608
diff
changeset
|
60 .Ar file . |
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
7608
diff
changeset
|
61 Special value |
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
7608
diff
changeset
|
62 .Cm stderr |
f18db38a9826
Core: "-e" command line option.
Igor Ippolitov <iippolitov@nginx.com>
parents:
7608
diff
changeset
|
63 indicates that the standard error output should be used. |
3788 | 64 .It Fl g Ar directives |
65 Set global configuration directives. | |
66 See | |
67 .Sx EXAMPLES | |
68 for details. | |
69 .It Fl p Ar prefix | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
70 Set the prefix path. |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
71 The default value is |
3788 | 72 .Pa %%PREFIX%% . |
73 .It Fl q | |
74 Suppress non-error messages during configuration testing. | |
75 .It Fl s Ar signal | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
76 Send a signal to the master process. |
3788 | 77 The argument |
78 .Ar signal | |
79 can be one of: | |
80 .Cm stop , quit , reopen , reload . | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
81 The following table shows the corresponding system signals: |
3788 | 82 .Pp |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
83 .Bl -tag -width ".Cm reopen" -compact |
3788 | 84 .It Cm stop |
85 .Dv SIGTERM | |
86 .It Cm quit | |
87 .Dv SIGQUIT | |
88 .It Cm reopen | |
89 .Dv SIGUSR1 | |
90 .It Cm reload | |
91 .Dv SIGHUP | |
92 .El | |
7608
4718a646187a
Update manpage, sort command line options.
Sergey A. Osokin <osa@FreeBSD.org.ru>
parents:
6189
diff
changeset
|
93 .It Fl T |
4718a646187a
Update manpage, sort command line options.
Sergey A. Osokin <osa@FreeBSD.org.ru>
parents:
6189
diff
changeset
|
94 Same as |
4718a646187a
Update manpage, sort command line options.
Sergey A. Osokin <osa@FreeBSD.org.ru>
parents:
6189
diff
changeset
|
95 .Fl t , |
4718a646187a
Update manpage, sort command line options.
Sergey A. Osokin <osa@FreeBSD.org.ru>
parents:
6189
diff
changeset
|
96 but additionally dump configuration files to standard output. |
3788 | 97 .It Fl t |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
98 Do not run, just test the configuration file. |
3788 | 99 .Nm |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
100 checks the configuration file syntax and then tries to open files |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
101 referenced in the configuration file. |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
102 .It Fl V |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
103 Print the |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
104 .Nm |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
105 version, compiler version, and |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
106 .Pa configure |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
107 script parameters. |
3788 | 108 .It Fl v |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
109 Print the |
3788 | 110 .Nm |
111 version. | |
112 .El | |
113 .Sh SIGNALS | |
114 The master process of | |
115 .Nm | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
116 can handle the following signals: |
3788 | 117 .Pp |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
118 .Bl -tag -width ".Dv SIGINT , SIGTERM" -compact |
3788 | 119 .It Dv SIGINT , SIGTERM |
120 Shut down quickly. | |
121 .It Dv SIGHUP | |
122 Reload configuration, start the new worker process with a new | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
123 configuration, and gracefully shut down old worker processes. |
3788 | 124 .It Dv SIGQUIT |
125 Shut down gracefully. | |
126 .It Dv SIGUSR1 | |
127 Reopen log files. | |
128 .It Dv SIGUSR2 | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
129 Upgrade the |
3788 | 130 .Nm |
131 executable on the fly. | |
132 .It Dv SIGWINCH | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
133 Shut down worker processes gracefully. |
3788 | 134 .El |
135 .Pp | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
136 While there is no need to explicitly control worker processes normally, |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
137 they support some signals too: |
3788 | 138 .Pp |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
139 .Bl -tag -width ".Dv SIGINT , SIGTERM" -compact |
3788 | 140 .It Dv SIGTERM |
141 Shut down quickly. | |
142 .It Dv SIGQUIT | |
143 Shut down gracefully. | |
144 .It Dv SIGUSR1 | |
145 Reopen log files. | |
146 .El | |
147 .Sh DEBUGGING LOG | |
148 To enable a debugging log, reconfigure | |
149 .Nm | |
150 to build with debugging: | |
151 .Pp | |
152 .Dl "./configure --with-debug ..." | |
153 .Pp | |
154 and then set the | |
155 .Cm debug | |
156 level of the | |
157 .Va error_log : | |
158 .Pp | |
159 .Dl "error_log /path/to/log debug;" | |
160 .Pp | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
161 It is also possible to enable the debugging for a particular IP address: |
3788 | 162 .Bd -literal -offset indent |
163 events { | |
164 debug_connection 127.0.0.1; | |
165 } | |
166 .Ed | |
4525
3ac1c784be40
Mentioned the NGINX environment variable.
Ruslan Ermilov <ru@nginx.com>
parents:
4523
diff
changeset
|
167 .Sh ENVIRONMENT |
3ac1c784be40
Mentioned the NGINX environment variable.
Ruslan Ermilov <ru@nginx.com>
parents:
4523
diff
changeset
|
168 The |
3ac1c784be40
Mentioned the NGINX environment variable.
Ruslan Ermilov <ru@nginx.com>
parents:
4523
diff
changeset
|
169 .Ev NGINX |
3ac1c784be40
Mentioned the NGINX environment variable.
Ruslan Ermilov <ru@nginx.com>
parents:
4523
diff
changeset
|
170 environment variable is used internally by |
3ac1c784be40
Mentioned the NGINX environment variable.
Ruslan Ermilov <ru@nginx.com>
parents:
4523
diff
changeset
|
171 .Nm |
3ac1c784be40
Mentioned the NGINX environment variable.
Ruslan Ermilov <ru@nginx.com>
parents:
4523
diff
changeset
|
172 and should not be set directly by the user. |
3788 | 173 .Sh FILES |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
174 .Bl -tag -width indent |
3788 | 175 .It Pa %%PID_PATH%% |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
176 Contains the process ID of |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
177 .Nm . |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
178 The contents of this file are not sensitive, so it can be world-readable. |
3788 | 179 .It Pa %%CONF_PATH%% |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
180 The main configuration file. |
3788 | 181 .It Pa %%ERROR_LOG_PATH%% |
182 Error log file. | |
183 .El | |
184 .Sh EXIT STATUS | |
185 Exit status is 0 on success, or 1 if the command fails. | |
186 .Sh EXAMPLES | |
187 Test configuration file | |
188 .Pa ~/mynginx.conf | |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
189 with global directives for PID and quantity of worker processes: |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
190 .Bd -literal -offset indent |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
191 nginx -t -c ~/mynginx.conf \e |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
192 -g "pid /var/run/mynginx.pid; worker_processes 2;" |
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
193 .Ed |
3788 | 194 .Sh SEE ALSO |
4001
6df31b324bbf
- Replaced explicit link to bugtracker with a support link
Ruslan Ermilov <ru@nginx.com>
parents:
4000
diff
changeset
|
195 .\"Xr nginx.conf 5 |
6df31b324bbf
- Replaced explicit link to bugtracker with a support link
Ruslan Ermilov <ru@nginx.com>
parents:
4000
diff
changeset
|
196 .\"Pp |
6df31b324bbf
- Replaced explicit link to bugtracker with a support link
Ruslan Ermilov <ru@nginx.com>
parents:
4000
diff
changeset
|
197 Documentation at |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
198 .Pa http://nginx.org/en/docs/ . |
4001
6df31b324bbf
- Replaced explicit link to bugtracker with a support link
Ruslan Ermilov <ru@nginx.com>
parents:
4000
diff
changeset
|
199 .Pp |
6df31b324bbf
- Replaced explicit link to bugtracker with a support link
Ruslan Ermilov <ru@nginx.com>
parents:
4000
diff
changeset
|
200 For questions and technical support, please refer to |
6df31b324bbf
- Replaced explicit link to bugtracker with a support link
Ruslan Ermilov <ru@nginx.com>
parents:
4000
diff
changeset
|
201 .Pa http://nginx.org/en/support.html . |
3788 | 202 .Sh HISTORY |
203 Development of | |
204 .Nm | |
3800 | 205 started in 2002, with the first public release on October 4, 2004. |
3788 | 206 .Sh AUTHORS |
4001
6df31b324bbf
- Replaced explicit link to bugtracker with a support link
Ruslan Ermilov <ru@nginx.com>
parents:
4000
diff
changeset
|
207 .An -nosplit |
7745
f57a478aa16d
Use .Mt to mark up email addresses.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7744
diff
changeset
|
208 .An Igor Sysoev Aq Mt igor@sysoev.ru . |
3788 | 209 .Pp |
4525
3ac1c784be40
Mentioned the NGINX environment variable.
Ruslan Ermilov <ru@nginx.com>
parents:
4523
diff
changeset
|
210 This manual page was originally written by |
7745
f57a478aa16d
Use .Mt to mark up email addresses.
Sergey Kandaurov <pluknet@nginx.com>
parents:
7744
diff
changeset
|
211 .An Sergey A. Osokin Aq Mt osa@FreeBSD.org.ru |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
212 as a result of compiling many |
3788 | 213 .Nm |
4523
731c71ef051b
- Applied some of the OpenBSD changes.
Ruslan Ermilov <ru@nginx.com>
parents:
4412
diff
changeset
|
214 documents from all over the world. |