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