comparison xml/en/docs/http/ngx_http_upstream_module.xml @ 1126:2e28d1c4a0a2

Upstream: revised layout of the "server" directive.
author Ruslan Ermilov <ru@nginx.com>
date Fri, 21 Mar 2014 10:55:50 +0400
parents 9a95b9026a16
children 948c853f5d22
comparison
equal deleted inserted replaced
1125:9a95b9026a16 1126:2e28d1c4a0a2
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> 8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
9 9
10 <module name="Module ngx_http_upstream_module" 10 <module name="Module ngx_http_upstream_module"
11 link="/en/docs/http/ngx_http_upstream_module.html" 11 link="/en/docs/http/ngx_http_upstream_module.html"
12 lang="en" 12 lang="en"
13 rev="17"> 13 rev="18">
14 14
15 <section id="summary"> 15 <section id="summary">
16 16
17 <para> 17 <para>
18 The <literal>ngx_http_upstream_module</literal> module 18 The <literal>ngx_http_upstream_module</literal> module
98 <example> 98 <example>
99 upstream backend { 99 upstream backend {
100 server backend1.example.com weight=5; 100 server backend1.example.com weight=5;
101 server 127.0.0.1:8080 max_fails=3 fail_timeout=30s; 101 server 127.0.0.1:8080 max_fails=3 fail_timeout=30s;
102 server unix:/tmp/backend3; 102 server unix:/tmp/backend3;
103
104 server backup1.example.com backup;
103 } 105 }
104 </example> 106 </example>
105 </para> 107 </para>
106 108
107 <para> 109 <para>
176 178
177 </list> 179 </list>
178 By default, the parameter is set to 10 seconds. 180 By default, the parameter is set to 10 seconds.
179 </tag-desc> 181 </tag-desc>
180 182
183 <tag-name><literal>backup</literal></tag-name>
184 <tag-desc>
185 marks the server as a backup server.
186 It will be passed requests when the primary servers are unavailable.
187 </tag-desc>
188
189 <tag-name><literal>down</literal></tag-name>
190 <tag-desc>
191 marks the server as permanently unavailable; used along with
192 the <link id="ip_hash"/> directive.
193 </tag-desc>
194
195 </list>
196 </para>
197
198 <para>
199 Additionally,
200 the following parameters are available as part of our <commercial_version/>:
201 <list type="tag">
202
203 <tag-name id="max_conns">
204 <literal>max_conns</literal>=<value>number</value>
205 </tag-name>
206 <tag-desc>
207 limits the maximum <value>number</value> of simultaneous connections to the
208 proxied server (1.5.9).
209 Default value is zero, meaning there is no limit.
210 </tag-desc>
211
212 <tag-name id="resolve">
213 <literal>resolve</literal>
214 </tag-name>
215 <tag-desc>
216 monitors changes of the IP addresses
217 that correspond to a domain name of the server,
218 and automatically modifies the upstream configuration
219 without the need of restarting nginx (1.5.12)
220 <para>
221 In order for this parameter to work,
222 the <link doc="ngx_http_core_module.xml" id="resolver"/> directive
223 must be specified in the
224 <link doc="ngx_http_core_module.xml" id="http"/> block.
225 <example>
226 http {
227 resolver 10.0.0.1;
228
229 upstream u {
230 zone ...;
231 ...
232 server example.com resolve;
233 }
234 }
235 </example>
236 </para>
237 </tag-desc>
238
239 <tag-name><literal>route</literal>=<value>string</value></tag-name>
240 <tag-desc>
241 sets the server route name.
242 </tag-desc>
243
181 <tag-name><literal>slow_start</literal>=<value>time</value></tag-name> 244 <tag-name><literal>slow_start</literal>=<value>time</value></tag-name>
182 <tag-desc> 245 <tag-desc>
183 sets the <value>time</value> during which the server will recover its weight 246 sets the <value>time</value> during which the server will recover its weight
184 from zero to a nominal value, when unhealthy server becomes 247 from zero to a nominal value, when unhealthy server becomes
185 <link id="health_check">healthy</link>, 248 <link id="health_check">healthy</link>,
186 or when the server becomes available after a period of time 249 or when the server becomes available after a period of time
187 it was considered unavailable. 250 it was considered unavailable.
188 Default value is zero, i.e. slow start is disabled. 251 Default value is zero, i.e. slow start is disabled.
189 <note>
190 This functionality is available as part of our <commercial_version/>.
191 </note>
192 </tag-desc>
193
194 <tag-name id="max_conns">
195 <literal>max_conns</literal>=<value>number</value>
196 </tag-name>
197 <tag-desc>
198 limits the maximum <value>number</value> of simultaneous connections to the
199 proxied server (1.5.9).
200 Default value is zero, meaning there is no limit.
201 <note>
202 This functionality is available as part of our <commercial_version/> only.
203 </note>
204 </tag-desc>
205
206 <tag-name><literal>backup</literal></tag-name>
207 <tag-desc>
208 marks the server as a backup server.
209 It will be passed requests when the primary servers are unavailable.
210 </tag-desc>
211
212 <tag-name><literal>down</literal></tag-name>
213 <tag-desc>
214 marks the server as permanently unavailable; used along with
215 the <link id="ip_hash"/> directive.
216 </tag-desc>
217
218 <tag-name id="resolve">
219 <literal>resolve</literal>
220 </tag-name>
221 <tag-desc>
222 monitors changes of the IP addresses
223 that correspond to a domain name of the server,
224 and automatically modifies the upstream configuration
225 without the need of restarting nginx (1.5.12)
226 <para>
227 In order for this parameter to work,
228 the <link doc="ngx_http_core_module.xml" id="resolver"/> directive
229 must be specified in the
230 <link doc="ngx_http_core_module.xml" id="http"/> block.
231 <example>
232 http {
233 resolver 10.0.0.1;
234
235 upstream u {
236 zone ...;
237 ...
238 server example.com resolve;
239 }
240 }
241 </example>
242 </para>
243 <note>
244 This functionality is available as part of our <commercial_version/>.
245 </note>
246 </tag-desc>
247
248 <tag-name><literal>route</literal>=<value>string</value></tag-name>
249 <tag-desc>
250 sets the server route name.
251 <note>
252 This functionality is available as part of our <commercial_version/>.
253 </note>
254 </tag-desc> 252 </tag-desc>
255 253
256 </list> 254 </list>
257 </para> 255 </para>
258 256
259 <para> 257 <para>
260 Example:
261 <example>
262 upstream backend {
263 server backend1.example.com weight=5;
264 server 127.0.0.1:8080 max_fails=3 fail_timeout=30s;
265 server unix:/tmp/backend3;
266
267 server backup1.example.com:8080 backup;
268 }
269 </example>
270
271 <note> 258 <note>
272 If there is only a single server in a group, <literal>max_fails</literal>, 259 If there is only a single server in a group, <literal>max_fails</literal>,
273 <literal>fail_timeout</literal> and <literal>slow_start</literal> parameters 260 <literal>fail_timeout</literal> and <literal>slow_start</literal> parameters
274 are ignored, and such a server will never be considered unavailable. 261 are ignored, and such a server will never be considered unavailable.
275 </note> 262 </note>