Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_upstream_module.xml @ 1199:5ee8a00f2bc5
Documented the uwsgi_modifier1 and uwsgi_modifier2 directives.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 20 May 2014 14:41:05 +0400 |
parents | 9264fdb6c833 |
children | 6cc809881694 |
rev | line source |
---|---|
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1 <?xml version="1.0"?> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
2 |
580
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
566
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
566
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
566
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
566
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
566
diff
changeset
|
7 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
9 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
10 <module name="Module ngx_http_upstream_module" |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
11 link="/en/docs/http/ngx_http_upstream_module.html" |
589 | 12 lang="en" |
1194 | 13 rev="23"> |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
14 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
15 <section id="summary"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
16 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
17 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
18 The <literal>ngx_http_upstream_module</literal> module |
966 | 19 is used to define groups of servers that can be referenced |
20 by the <link doc="ngx_http_proxy_module.xml" id="proxy_pass"/>, | |
1181 | 21 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_pass"/>, |
1194 | 22 <link doc="ngx_http_uwsgi_module.xml" id="uwsgi_pass"/>, |
1181 | 23 <link doc="ngx_http_scgi_module.xml" id="scgi_pass"/>, and |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
24 <link doc="ngx_http_memcached_module.xml" id="memcached_pass"/> directives. |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
25 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
26 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
27 </section> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
29 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
30 <section id="example" name="Example Configuration"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 <example> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 upstream <emphasis>backend</emphasis> { |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 server backend1.example.com weight=5; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
36 server backend2.example.com:8080; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
37 server unix:/tmp/backend3; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
38 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 server backup1.example.com:8080 backup; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 server backup2.example.com:8080 backup; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 } |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 server { |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 location / { |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
45 proxy_pass http://<emphasis>backend</emphasis>; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 } |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 } |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
48 </example> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
49 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
50 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
51 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
52 Dynamically configurable group, |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
53 available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
54 <commercial_version>commercial subscription</commercial_version>: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
55 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
56 upstream <emphasis>appservers</emphasis> { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
57 zone appservers 64k; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
58 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
59 server appserv1.example.com weight=5; |
955
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
60 server appserv2.example.com:8080 fail_timeout=5s slow_start=30s; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
61 server 192.0.2.1 max_fails=3; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
62 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
63 server reserve1.example.com:8080 backup; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
64 server reserve2.example.com:8080 backup; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
65 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
66 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
67 server { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
68 location / { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
69 proxy_pass http://<emphasis>appservers</emphasis>; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
70 health_check; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
71 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
72 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
73 location /upstream_conf { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
74 upstream_conf; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
75 allow 127.0.0.1; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
76 deny all; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
77 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
78 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
79 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
80 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
81 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 </section> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
83 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
84 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
85 <section id="directives" name="Directives"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
86 |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
87 <directive name="upstream"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
88 <syntax block="yes"><value>name</value></syntax> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
89 <default/> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
90 <context>http</context> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
91 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
92 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
93 Defines a group of servers. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
94 Servers can listen on different ports. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
95 In addition, servers listening on TCP and UNIX-domain sockets |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
96 can be mixed. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
97 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
98 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
99 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
100 Example: |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
101 <example> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
102 upstream backend { |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
103 server backend1.example.com weight=5; |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
104 server 127.0.0.1:8080 max_fails=3 fail_timeout=30s; |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
105 server unix:/tmp/backend3; |
1126
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
106 |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
107 server backup1.example.com backup; |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
108 } |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
109 </example> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
110 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
111 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
112 <para> |
966 | 113 By default, requests are distributed between the servers using a |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
114 weighted round-robin balancing method. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
115 In the above example, each 7 requests will be distributed as follows: |
966 | 116 5 requests go to <literal>backend1.example.com</literal> |
117 and one request to each of the second and third servers. | |
118 If an error occurs during communication with a server, the request will | |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
119 be passed to the next server, and so on until all of the functioning |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
120 servers will be tried. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
121 If a successful response could not be obtained from any of the servers, |
966 | 122 the client will receive the result of the communication with the last server. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
123 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
124 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
125 </directive> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
126 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
127 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
128 <directive name="server"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
129 <syntax><value>address</value> [<value>parameters</value>]</syntax> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
130 <default/> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
131 <context>upstream</context> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
132 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
133 <para> |
966 | 134 Defines the <value>address</value> and other <value>parameters</value> |
135 of a server. | |
136 The address can be specified as a domain name or IP address, | |
137 with an optional port, or as a UNIX-domain socket path | |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
138 specified after the “<literal>unix:</literal>” prefix. |
966 | 139 If a port is not specified, the port 80 is used. |
140 A domain name that resolves to several IP addresses defines | |
141 multiple servers at once. | |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
142 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
143 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
144 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
145 The following parameters can be defined: |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
146 <list type="tag"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
147 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
148 <tag-name><literal>weight</literal>=<value>number</value></tag-name> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
149 <tag-desc> |
966 | 150 sets the weight of the server, by default, 1. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
151 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
152 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
153 <tag-name><literal>max_fails</literal>=<value>number</value></tag-name> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
154 <tag-desc> |
966 | 155 sets the number of unsuccessful attempts to communicate with the server |
156 that should happen in the duration set by the <literal>fail_timeout</literal> | |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
157 parameter to consider the server unavailable for a duration also set by the |
966 | 158 <literal>fail_timeout</literal> parameter. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
159 By default, the number of unsuccessful attempts is set to 1. |
966 | 160 The zero value disables the accounting of attempts. |
942
ba3d6ade3513
Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents:
917
diff
changeset
|
161 What is considered an unsuccessful attempt is defined by the |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
162 <link doc="ngx_http_proxy_module.xml" id="proxy_next_upstream"/>, |
1181 | 163 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_next_upstream"/>, |
1194 | 164 <link doc="ngx_http_uwsgi_module.xml" id="uwsgi_next_upstream"/>, |
1181 | 165 <link doc="ngx_http_scgi_module.xml" id="scgi_next_upstream"/>, and |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
166 <link doc="ngx_http_memcached_module.xml" id="memcached_next_upstream"/> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
167 directives. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
168 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
169 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
170 <tag-name><literal>fail_timeout</literal>=<value>time</value></tag-name> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
171 <tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
172 sets |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
173 <list type="bullet"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
174 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
175 <listitem> |
966 | 176 the time during which the specified number of unsuccessful attempts to |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
177 communicate with the server should happen to consider the server unavailable; |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
178 </listitem> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
179 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
180 <listitem> |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
181 and the period of time the server will be considered unavailable. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
182 </listitem> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
183 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
184 </list> |
966 | 185 By default, the parameter is set to 10 seconds. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
186 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
187 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
188 <tag-name><literal>backup</literal></tag-name> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
189 <tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
190 marks the server as a backup server. |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
191 It will be passed requests when the primary servers are unavailable. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
192 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
193 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
194 <tag-name><literal>down</literal></tag-name> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
195 <tag-desc> |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
196 marks the server as permanently unavailable; used along with |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
197 the <link id="ip_hash"/> directive. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
198 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
199 |
1126
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
200 </list> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
201 </para> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
202 |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
203 <para> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
204 Additionally, |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
205 the following parameters are available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
206 <commercial_version>commercial subscription</commercial_version>: |
1126
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
207 <list type="tag"> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
208 |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
209 <tag-name id="max_conns"> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
210 <literal>max_conns</literal>=<value>number</value> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
211 </tag-name> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
212 <tag-desc> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
213 limits the maximum <value>number</value> of simultaneous connections to the |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
214 proxied server (1.5.9). |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
215 Default value is zero, meaning there is no limit. |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
216 </tag-desc> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
217 |
1124
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
218 <tag-name id="resolve"> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
219 <literal>resolve</literal> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
220 </tag-name> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
221 <tag-desc> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
222 monitors changes of the IP addresses |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
223 that correspond to a domain name of the server, |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
224 and automatically modifies the upstream configuration |
1127
948c853f5d22
Upstream: improved "server resolve".
Ruslan Ermilov <ru@nginx.com>
parents:
1126
diff
changeset
|
225 without the need of restarting nginx (1.5.12). |
1124
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
226 <para> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
227 In order for this parameter to work, |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
228 the <link doc="ngx_http_core_module.xml" id="resolver"/> directive |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
229 must be specified in the |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
230 <link doc="ngx_http_core_module.xml" id="http"/> block. |
1127
948c853f5d22
Upstream: improved "server resolve".
Ruslan Ermilov <ru@nginx.com>
parents:
1126
diff
changeset
|
231 Example: |
1124
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
232 <example> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
233 http { |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
234 resolver 10.0.0.1; |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
235 |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
236 upstream u { |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
237 zone ...; |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
238 ... |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
239 server example.com resolve; |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
240 } |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
241 } |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
242 </example> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
243 </para> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
244 </tag-desc> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
245 |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
246 <tag-name><literal>route</literal>=<value>string</value></tag-name> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
247 <tag-desc> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
248 sets the server route name. |
1126
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
249 </tag-desc> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
250 |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
251 <tag-name><literal>slow_start</literal>=<value>time</value></tag-name> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
252 <tag-desc> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
253 sets the <value>time</value> during which the server will recover its weight |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
254 from zero to a nominal value, when unhealthy server becomes |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
255 <link id="health_check">healthy</link>, |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
256 or when the server becomes available after a period of time |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
257 it was considered unavailable. |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
258 Default value is zero, i.e. slow start is disabled. |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
259 </tag-desc> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
260 |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
261 </list> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
262 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
263 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
264 <para> |
969
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
265 <note> |
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
266 If there is only a single server in a group, <literal>max_fails</literal>, |
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
267 <literal>fail_timeout</literal> and <literal>slow_start</literal> parameters |
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
268 are ignored, and such a server will never be considered unavailable. |
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
269 </note> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
270 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
271 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
272 </directive> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
273 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
274 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
275 <directive name="zone"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
276 <syntax><value>name</value> <value>size</value></syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
277 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
278 <context>upstream</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
279 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
280 <para> |
1123
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
281 Defines the <value>name</value> and <value>size</value> of the shared |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
282 memory zone that keeps the group’s configuration and run-time state that are |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
283 shared between worker processes. |
1123
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
284 Such groups allow changing the group membership |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
285 or modifying the settings of a particular server |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
286 without the need of restarting nginx. |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
287 The configuration is accessible via a special location |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
288 handled by <link id="upstream_conf"/>. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
289 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
290 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
291 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
292 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
293 This directive is available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
294 <commercial_version>commercial subscription</commercial_version>. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
295 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
296 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
297 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
298 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
299 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
300 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
301 <directive name="ip_hash"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
302 <syntax/> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
303 <default/> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
304 <context>upstream</context> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
305 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
306 <para> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
307 Specifies that a group should use a load balancing method where requests |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
308 are distributed between servers based on client IP addresses. |
542
a9e6a8613534
Documented IPv6 support in ip_hash.
Ruslan Ermilov <ru@nginx.com>
parents:
533
diff
changeset
|
309 The first three octets of the client IPv4 address, or the entire IPv6 address, |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
310 are used as a hashing key. |
966 | 311 The method ensures that requests from the same client will always be |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
312 passed to the same server except when this server is unavailable. |
966 | 313 In the latter case client requests will be passed to another server. |
314 Most probably, it will always be the same server as well. | |
542
a9e6a8613534
Documented IPv6 support in ip_hash.
Ruslan Ermilov <ru@nginx.com>
parents:
533
diff
changeset
|
315 <note> |
566 | 316 IPv6 addresses are supported starting from versions 1.3.2 and 1.2.2. |
542
a9e6a8613534
Documented IPv6 support in ip_hash.
Ruslan Ermilov <ru@nginx.com>
parents:
533
diff
changeset
|
317 </note> |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
318 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
319 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
320 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
321 If one of the servers needs to be temporarily removed, it should |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
322 be marked with the <literal>down</literal> parameter in |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
323 order to preserve the current hashing of client IP addresses. |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
324 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
325 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
326 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
327 Example: |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
328 <example> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
329 upstream backend { |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
330 ip_hash; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
331 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
332 server backend1.example.com; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
333 server backend2.example.com; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
334 server backend3.example.com <emphasis>down</emphasis>; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
335 server backend4.example.com; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
336 } |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
337 </example> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
338 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
339 |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
340 <para> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
341 <note> |
966 | 342 Until versions 1.3.1 and 1.2.2, it was not possible to specify a weight for |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
343 servers using the <literal>ip_hash</literal> load balancing method. |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
344 </note> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
345 </para> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
346 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
347 </directive> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
348 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
349 |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
350 <directive name="keepalive"> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
351 <syntax><value>connections</value></syntax> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
352 <default/> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
353 <context>upstream</context> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
354 <appeared-in>1.1.4</appeared-in> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
355 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
356 <para> |
966 | 357 Activates the cache for connections to upstream servers. |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
358 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
359 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
360 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
361 The <value>connections</value> parameter sets the maximum number of |
966 | 362 idle keepalive connections to upstream servers that are preserved in |
363 the cache of each worker process. | |
654
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
364 When this number is exceeded, the least recently used connections |
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
365 are closed. |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
366 <note> |
966 | 367 It should be particularly noted that the <literal>keepalive</literal> directive |
368 does not limit the total number of connections to upstream servers | |
369 that an nginx worker process can open. | |
370 The <value>connections</value> parameter should be set to a number small enough | |
371 to let upstream servers process new incoming connections as well. | |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
372 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
373 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
374 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
375 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
376 Example configuration of memcached upstream with keepalive connections: |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
377 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
378 upstream memcached_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
379 server 127.0.0.1:11211; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
380 server 10.0.0.2:11211; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
381 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
382 keepalive 32; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
383 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
384 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
385 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
386 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
387 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
388 location /memcached/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
389 set $memcached_key $uri; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
390 memcached_pass memcached_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
391 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
392 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
393 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
394 </example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
395 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
396 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
397 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
398 For HTTP, the <link doc="ngx_http_proxy_module.xml" id="proxy_http_version"/> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
399 directive should be set to “<literal>1.1</literal>” |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
400 and the <header>Connection</header> header field should be cleared: |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
401 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
402 upstream http_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
403 server 127.0.0.1:8080; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
404 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
405 keepalive 16; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
406 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
407 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
408 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
409 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
410 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
411 location /http/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
412 proxy_pass http://http_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
413 proxy_http_version 1.1; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
414 proxy_set_header Connection ""; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
415 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
416 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
417 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
418 </example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
419 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
420 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
421 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
422 <note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
423 Alternatively, HTTP/1.0 persistent connections can be used by passing the |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
424 <header>Connection: Keep-Alive</header> header field to an upstream server, |
966 | 425 though this method is not recommended. |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
426 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
427 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
428 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
429 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
430 For FastCGI servers, it is required to set |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
431 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_keep_conn"/> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
432 for keepalive connections to work: |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
433 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
434 upstream fastcgi_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
435 server 127.0.0.1:9000; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
436 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
437 keepalive 8; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
438 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
439 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
440 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
441 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
442 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
443 location /fastcgi/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
444 fastcgi_pass fastcgi_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
445 fastcgi_keep_conn on; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
446 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
447 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
448 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
449 </example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
450 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
451 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
452 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
453 <note> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
454 When using load balancer methods other than the default |
966 | 455 round-robin method, it is necessary to activate them before |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
456 the <literal>keepalive</literal> directive. |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
457 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
458 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
459 <note> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
460 SCGI and uwsgi protocols do not have a notion of keepalive connections. |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
461 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
462 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
463 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
464 </directive> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
465 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
466 |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
467 <directive name="least_conn"> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
468 <syntax/> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
469 <default/> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
470 <context>upstream</context> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
471 <appeared-in>1.3.1</appeared-in> |
566 | 472 <appeared-in>1.2.2</appeared-in> |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
473 |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
474 <para> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
475 Specifies that a group should use a load balancing method where a request |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
476 is passed to the server with the least number of active connections, |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
477 taking into account weights of servers. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
478 If there are several such servers, they are tried using a |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
479 weighted round-robin balancing method. |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
480 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
481 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
482 </directive> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
483 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
484 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
485 <directive name="health_check"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
486 <syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
487 [<literal>interval=</literal><value>time</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
488 <!-- |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
489 [<literal>jitter=</literal><value>time</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
490 --> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
491 [<literal>fails=</literal><value>number</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
492 [<literal>passes=</literal><value>number</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
493 [<literal>uri=</literal><value>uri</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
494 [<literal>match=</literal><value>name</value>]</syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
495 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
496 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
497 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
498 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
499 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
500 Enables periodic health checks of the servers in a |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
501 <link id="upstream">group</link> referenced in the surrounding location. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
502 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
503 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
504 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
505 The following optional parameters are supported: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
506 <list type="bullet"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
507 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
508 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
509 <literal>interval</literal> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
510 sets the interval between two consecutive health checks, |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
511 by default, 5 seconds; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
512 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
513 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
514 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
515 <literal>fails</literal> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
516 sets the number of consecutive failed health checks of a particular server |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
517 after which this server will be considered unhealthy, |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
518 by default, 1; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
519 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
520 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
521 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
522 <literal>passes</literal> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
523 sets the number of consecutive passed health checks of a particular server |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
524 after which the server will be considered healthy, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
525 by default, 1; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
526 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
527 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
528 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
529 <literal>uri</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
530 defines the URI used in health check requests, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
531 by default, “<literal>/</literal>”; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
532 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
533 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
534 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
535 <literal>match</literal> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
536 specifies the <literal>match</literal> block configuring the tests that a |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
537 response should pass in order for a health check to pass; |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
538 by default, the response should have status code 2xx or 3xx. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
539 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
540 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
541 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
542 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
543 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
544 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
545 For example, |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
546 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
547 location / { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
548 proxy_pass http://backend; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
549 health_check; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
550 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
551 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
552 will send “<literal>/</literal>” requests to each |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
553 server in the <literal>backend</literal> group every five seconds. |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
554 If any communication error or timeout occurs, or a |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
555 proxied server responds with the status code other than |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
556 2xx or 3xx, the health check will fail, and the server will |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
557 be considered unhealthy. |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
558 Client requests are not passed to unhealthy servers. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
559 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
560 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
561 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
562 Health checks can be configured to test the status code of a response, |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
563 presence of certain header fields and their values, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
564 and the body contents. |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
565 Tests are configured separately using the <link id="match"/> directive |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
566 and referenced in the <literal>match</literal> parameter. |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
567 For example: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
568 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
569 http { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
570 server { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
571 ... |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
572 location / { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
573 proxy_pass http://backend; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
574 health_check match=welcome; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
575 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
576 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
577 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
578 match welcome { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
579 status 200; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
580 header Content-Type = text/html; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
581 body ~ "Welcome to nginx!"; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
582 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
583 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
584 </example> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
585 This configuration tells that for a health check to pass, the response to a |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
586 health check request should succeed, |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
587 have status 200, content type “<literal>text/html</literal>”, |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
588 and contain “<literal>Welcome to nginx!</literal>” in the body. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
589 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
590 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
591 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
592 The server group must reside in the <link id="zone">shared memory</link>. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
593 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
594 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
595 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
596 If several health checks are defined for the same group of servers, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
597 a single failure of any check will make the corresponding server be |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
598 considered unhealthy. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
599 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
600 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
601 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
602 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
603 This directive is available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
604 <commercial_version>commercial subscription</commercial_version>. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
605 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
606 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
607 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
608 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
609 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
610 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
611 <directive name="match"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
612 <syntax block="yes"><value>name</value></syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
613 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
614 <context>http</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
615 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
616 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
617 Defines the named test set used to verify responses to health check requests. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
618 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
619 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
620 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
621 The following items can be tested in a response: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
622 <list type="tag"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
623 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
624 <tag-name><literal>status 200;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
625 <tag-desc>status is 200</tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
626 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
627 <tag-name><literal>status ! 500;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
628 <tag-desc>status is not 500</tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
629 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
630 <tag-name><literal>status 200 204;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
631 <tag-desc>status is 200 or 204</tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
632 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
633 <tag-name><literal>status ! 301 302;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
634 <tag-desc>status is neither 301 nor 302</tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
635 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
636 <tag-name><literal>status 200-399;</literal></tag-name> |
966 | 637 <tag-desc>status is in the range from 200 to 399</tag-desc> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
638 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
639 <tag-name><literal>status ! 400-599;</literal></tag-name> |
966 | 640 <tag-desc>status is not in the range from 400 to 599</tag-desc> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
641 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
642 <tag-name><literal>status 301-303 307;</literal></tag-name> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
643 <tag-desc>status is either 301, 302, 303, or 307</tag-desc> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
644 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
645 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
646 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
647 <list type="tag"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
648 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
649 <tag-name><literal>header Content-Type = text/html;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
650 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
651 header contains <header>Content-Type</header> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
652 with value <literal>text/html</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
653 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
654 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
655 <tag-name><literal>header Content-Type != text/html;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
656 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
657 header contains <header>Content-Type</header> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
658 with value other than <literal>text/html</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
659 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
660 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
661 <tag-name><literal>header Connection ~ close;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
662 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
663 header contains <header>Connection</header> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
664 with value matching regular expression <literal>close</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
665 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
666 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
667 <tag-name><literal>header Connection !~ close;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
668 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
669 header contains <header>Connection</header> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
670 with value not matching regular expression <literal>close</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
671 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
672 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
673 <tag-name><literal>header Host;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
674 <tag-desc>header contains <header>Host</header></tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
675 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
676 <tag-name><literal>header ! X-Accel-Redirect;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
677 <tag-desc>header lacks <header>X-Accel-Redirect</header></tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
678 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
679 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
680 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
681 <list type="tag"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
682 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
683 <tag-name><literal>body ~ "Welcome to nginx!";</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
684 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
685 body matches regular expression “<literal>Welcome to nginx!</literal>” |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
686 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
687 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
688 <tag-name><literal>body !~ "Welcome to nginx!";</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
689 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
690 body does not match regular expression “<literal>Welcome to nginx!</literal>” |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
691 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
692 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
693 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
694 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
695 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
696 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
697 If several tests are specified, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
698 the response matches only if it matches all tests. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
699 <note> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
700 Only the first 256k of the response body are examined. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
701 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
702 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
703 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
704 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
705 Examples: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
706 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
707 # status is 200, content type is "text/html", |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
708 # and body contains "Welcome to nginx!" |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
709 match welcome { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
710 status 200; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
711 header Content-Type = text/html; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
712 body ~ "Welcome to nginx!"; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
713 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
714 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
715 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
716 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
717 # status is not one of 301, 302, 303, or 307, and header does not have "Refresh:" |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
718 match not_redirect { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
719 status ! 301-303 307; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
720 header ! Refresh; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
721 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
722 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
723 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
724 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
725 # status ok and not in maintenance mode |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
726 match server_ok { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
727 status 200-399; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
728 body !~ "maintenance mode"; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
729 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
730 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
731 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
732 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
733 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
734 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
735 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
736 This directive is available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
737 <commercial_version>commercial subscription</commercial_version>. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
738 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
739 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
740 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
741 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
742 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
743 |
1125
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
744 <directive name="queue"> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
745 <syntax> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
746 <value>number</value> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
747 [<literal>timeout</literal>=<value>time</value>]</syntax> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
748 <default/> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
749 <context>upstream</context> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
750 <appeared-in>1.5.12</appeared-in> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
751 |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
752 <para> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
753 If an upstream server cannot be selected immediately |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
754 while processing a request, |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
755 and there are the servers in the group that have reached the |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
756 <link id="max_conns"/> limit, |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
757 the request will be placed into the queue. |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
758 The directive specifies the maximum number of requests that can be in the queue |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
759 at the same time. |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
760 If the queue is filled up, |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
761 or the server to pass the request to cannot been selected within |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
762 the time period specified in the <literal>timeout</literal> parameter, |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
763 an error will be returned to the client. |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
764 </para> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
765 |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
766 <para> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
767 The default value of the <literal>timeout</literal> parameter is 60 seconds. |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
768 </para> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
769 |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
770 <para> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
771 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
772 This directive is available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
773 <commercial_version>commercial subscription</commercial_version>. |
1125
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
774 </note> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
775 </para> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
776 |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
777 </directive> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
778 |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
779 |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
780 <directive name="sticky"> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
781 <syntax><literal>cookie</literal> <value>name</value> |
1001
35ae9ded0465
Updated the "sticky" directive description.
Vladimir Homutov <vl@nginx.com>
parents:
988
diff
changeset
|
782 [<literal>expires=</literal><value>time</value>] |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
783 [<literal>domain=</literal><value>domain</value>] |
1001
35ae9ded0465
Updated the "sticky" directive description.
Vladimir Homutov <vl@nginx.com>
parents:
988
diff
changeset
|
784 [<literal>path=</literal><value>path</value>]</syntax> |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
785 <syntax><literal>route</literal> <value>variable</value> ...</syntax> |
987
edd505634357
Documented the "sticky" directive.
Vladimir Homutov <vl@nginx.com>
parents:
981
diff
changeset
|
786 <default/> |
edd505634357
Documented the "sticky" directive.
Vladimir Homutov <vl@nginx.com>
parents:
981
diff
changeset
|
787 <context>upstream</context> |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
788 <appeared-in>1.5.7</appeared-in> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
789 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
790 <para> |
962
f3754c623e6b
Minor editing of the stiky_cookie_insert directive.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
960
diff
changeset
|
791 Enables session affinity, which causes requests from the same client to be |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
792 passed to the same server in a group of servers. |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
793 Two methods are available, |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
794 <literal>cookie</literal> and <literal>route</literal>. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
795 </para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
796 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
797 <para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
798 When the <literal>cookie</literal> method is used, information about the |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
799 designated server is passed in an HTTP cookie: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
800 <example> |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
801 upstream backend { |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
802 server backend1.example.com; |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
803 server backend2.example.com; |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
804 |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
805 sticky cookie srv_id expires=1h domain=.example.com path=/; |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
806 } |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
807 </example> |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
808 </para> |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
809 |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
810 <para> |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
811 A request that comes from a client not yet bound to a particular server |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
812 is passed to the server selected by the configured balancing method. |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
813 Further requests from the same client are passed to the same server. |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
814 If the designated server cannot process a request, the new server is |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
815 selected as if the client has not been bound yet. |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
816 </para> |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
817 |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
818 <para> |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
819 The first parameter sets the name of the cookie to be set or inspected. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
820 Additional parameters may be as follows: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
821 <list type="tag"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
822 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
823 <tag-name><literal>expires</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
824 <tag-desc> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
825 Sets the time for which a browser should keep the cookie. |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
826 The special value <literal>max</literal> will cause the cookie to expire on |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
827 “<literal>31 Dec 2037 23:55:55 GMT</literal>”. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
828 This is the maximum time understood by old browsers. |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
829 If the parameter is not specified, it will cause the cookie to expire at |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
830 the end of a browser session. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
831 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
832 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
833 <tag-name><literal>domain</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
834 <tag-desc> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
835 Defines the domain for which the cookie is set. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
836 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
837 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
838 <tag-name><literal>path</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
839 <tag-desc> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
840 Defines the path for which the cookie is set. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
841 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
842 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
843 </list> |
981 | 844 If any parameters are omitted, the corresponding cookie fields are not set. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
845 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
846 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
847 <para> |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
848 When the <literal>route</literal> method is used, proxied server assigns |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
849 client a route on receipt of the first request. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
850 All subsequent requests from this client will carry routing information |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
851 in a cookie or URI. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
852 This information is compared with the “<literal>route</literal>” parameter |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
853 of the <link id="server"/> directive to identify the server to which the |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
854 request should be proxied. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
855 If the designated server cannot process a request, the new server is |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
856 selected by the configured balancing method as if there is no routing |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
857 information in the request. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
858 </para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
859 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
860 <para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
861 The parameters of the <literal>route</literal> method specify variables that |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
862 may contain routing information. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
863 The first non-empty variable is used to find the matching server. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
864 </para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
865 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
866 <para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
867 Example: |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
868 <example> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
869 map $cookie_jsessionid $route_cookie { |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
870 ~.+\.(?P<route>\w+)$ $route; |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
871 } |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
872 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
873 map $request_uri $route_uri { |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
874 ~jsessionid=.+\.(?P<route>\w+)$ $route; |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
875 } |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
876 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
877 upstream backend { |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
878 server backend1.example.com route=a; |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
879 server backend2.example.com route=b; |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
880 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
881 sticky route $route_cookie $route_uri; |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
882 } |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
883 </example> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
884 Here, the route is taken from the “<literal>JSESSIONID</literal>” cookie |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
885 if present in a request. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
886 Otherwise, the route from the URI is used. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
887 </para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
888 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
889 <para> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
890 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
891 This directive is available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
892 <commercial_version>commercial subscription</commercial_version>. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
893 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
894 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
895 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
896 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
897 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
898 |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
899 <directive name="sticky_cookie_insert"> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
900 <syntax><value>name</value> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
901 [<literal>expires=</literal><value>time</value>] |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
902 [<literal>domain=</literal><value>domain</value>] |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
903 [<literal>path=</literal><value>path</value>]</syntax> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
904 <default/> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
905 <context>upstream</context> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
906 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
907 <para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
908 This directive is obsolete since version 1.5.7. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
909 An equivalent |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
910 <link id="sticky"/> directive with a new syntax should be used instead: |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
911 <note> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
912 <literal>sticky cookie</literal> <value>name</value> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
913 [<literal>expires=</literal><value>time</value>] |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
914 [<literal>domain=</literal><value>domain</value>] |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
915 [<literal>path=</literal><value>path</value>]; |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
916 </note> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
917 </para> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
918 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
919 </directive> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
920 |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
921 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
922 <directive name="upstream_conf"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
923 <syntax/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
924 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
925 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
926 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
927 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
928 Turns on the HTTP interface of upstream configuration in the surrounding |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
929 location. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
930 Access to this location should be |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
931 <link doc="ngx_http_core_module.xml" id="satisfy">limited</link>. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
932 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
933 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
934 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
935 Configuration commands can be used to: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
936 <list type="bullet"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
937 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
938 <listitem>view all primary or backup servers in a group;</listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
939 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
940 <listitem>view an individual server;</listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
941 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
942 <listitem>modify an individual server;</listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
943 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
944 <listitem>add a new server (see the note below);</listitem> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
945 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
946 <listitem>remove an individual server.</listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
947 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
948 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
949 <note> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
950 As noted in the <link id="server"/> directive, specifying a server |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
951 as a domain name may result in several servers being added to the group. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
952 Since addresses in a group are not required to be unique, individual |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
953 servers in a group can be uniquely referenced to only by their ID. |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
954 IDs are assigned automatically and shown on viewing of the group configuration. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
955 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
956 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
957 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
958 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
959 A configuration command consists of parameters passed as request arguments, |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
960 for example: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
961 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
962 http://127.0.0.1/upstream_conf?upstream=appservers |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
963 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
964 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
965 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
966 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
967 The following parameters are supported: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
968 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
969 <list type="tag" compact="no"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
970 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
971 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
972 <literal>upstream=</literal><value>name</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
973 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
974 Selects a group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
975 This parameter is mandatory. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
976 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
977 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
978 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
979 <literal>backup=</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
980 </tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
981 <tag-desc> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
982 If not set, selects primary servers in the group. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
983 If set, selects backup servers in the group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
984 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
985 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
986 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
987 <literal>id=</literal><value>number</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
988 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
989 Selects an individual primary or backup server in the group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
990 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
991 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
992 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
993 <literal>remove=</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
994 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
995 Removes an individual primary or backup server from the group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
996 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
997 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
998 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
999 <literal>add=</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1000 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1001 Adds a new primary or backup server to the group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1002 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1003 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1004 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1005 <literal>server=</literal><value>address</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1006 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1007 Same as the “<literal>address</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1008 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1009 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1010 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1011 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1012 <literal>weight=</literal><value>number</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1013 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1014 Same as the “<literal>weight</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1015 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1016 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1017 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1018 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1019 <literal>max_fails=</literal><value>number</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1020 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1021 Same as the “<literal>max_fails</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1022 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1023 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1024 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1025 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1026 <literal>fail_timeout=</literal><value>time</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1027 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1028 Same as the “<literal>fail_timeout</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1029 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1030 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1031 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1032 <tag-name> |
955
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
1033 <literal>slow_start=</literal><value>time</value></tag-name> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
1034 <tag-desc> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
1035 Same as the “<literal>slow_start</literal>” parameter |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
1036 of the <link id="server"/> directive. |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
1037 </tag-desc> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
1038 |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
1039 <tag-name> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1040 <literal>down=</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1041 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1042 Same as the “<literal>down</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1043 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1044 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1045 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1046 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1047 <literal>up=</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1048 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1049 The opposite of the “<literal>down</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1050 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1051 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1052 |
1026
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
1053 <tag-name> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
1054 <literal>route=</literal><value>string</value></tag-name> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
1055 <tag-desc> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
1056 Same as the “<literal>route</literal>” parameter |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
1057 of the <link id="server"/> directive. |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
1058 </tag-desc> |
3056640d5022
Upstream: documented new "sticky" features.
Ruslan Ermilov <ru@nginx.com>
parents:
1011
diff
changeset
|
1059 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1060 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1061 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1062 The first three parameters select a target the command applies to. |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1063 Without other parameters, the command shows configuration of the selected |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1064 target. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1065 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1066 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1067 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1068 For example, to view the primary servers in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1069 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1070 http://127.0.0.1/upstream_conf?upstream=appservers |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1071 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1072 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1073 To view the backup servers in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1074 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1075 http://127.0.0.1/upstream_conf?upstream=appservers&backup= |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1076 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1077 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1078 To view an individual primary server in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1079 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1080 http://127.0.0.1/upstream_conf?upstream=appservers&id=42 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1081 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1082 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1083 To view an individual backup server in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1084 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1085 http://127.0.0.1/upstream_conf?upstream=appservers&backup=&id=42 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1086 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1087 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1088 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1089 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1090 To add a new primary or backup server to the group, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1091 specify its address in the “<literal>server=</literal>” parameter. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1092 Without other parameters specified, a server will be added with other |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1093 parameters set to their default values (see the <link id="server"/> directive). |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1094 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1095 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1096 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1097 For example, to add a new primary server to the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1098 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1099 http://127.0.0.1/upstream_conf?add=&upstream=appservers&server=127.0.0.1:8080 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1100 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1101 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1102 To add a new backup server to the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1103 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1104 http://127.0.0.1/upstream_conf?add=&upstream=appservers&backup=&server=127.0.0.1:8080 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1105 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1106 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1107 To add a new primary server to the group, |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1108 set its parameters to non-default values |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
1109 and mark it as “<literal>down</literal>”, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1110 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1111 http://127.0.0.1/upstream_conf?add=&upstream=appservers&server=127.0.0.1:8080&weight=2&max_fails=3&fail_timeout=3s&down= |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1112 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1113 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1114 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1115 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1116 To remove an individual primary or backup server from the group, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1117 select it with the <literal>id=</literal> parameter. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1118 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1119 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1120 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1121 For example, to remove an individual primary server from the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1122 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1123 http://127.0.0.1/upstream_conf?remove=&upstream=appservers&id=42 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1124 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1125 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1126 To remove an individual backup server from the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1127 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1128 http://127.0.0.1/upstream_conf?remove=&upstream=appservers&backup=&id=42 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1129 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1130 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1131 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1132 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1133 To modify an individual primary or backup server in the group, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1134 select it with the <literal>id=</literal> parameter. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1135 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1136 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1137 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1138 For example, to modify an individual primary server in the group |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1139 by marking it as “<literal>down</literal>”, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1140 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1141 http://127.0.0.1/upstream_conf?upstream=appservers&id=42&down= |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1142 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1143 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1144 To modify the address of an individual backup server in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1145 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1146 http://127.0.0.1/upstream_conf?upstream=appservers&backup=&id=42&server=192.0.2.3:8123 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1147 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1148 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
1149 To modify other parameters of an individual primary server in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1150 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1151 http://127.0.0.1/upstream_conf?upstream=appservers&id=42&max_fails=3&weight=4 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1152 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1153 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1154 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1155 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1156 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1157 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
1158 This directive is available as part of our |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
1159 <commercial_version>commercial subscription</commercial_version>. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1160 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1161 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1162 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1163 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
1164 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1165 </section> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1166 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1167 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1168 <section id="variables" name="Embedded Variables"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1169 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1170 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1171 The <literal>ngx_http_upstream_module</literal> module |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1172 supports the following embedded variables: |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1173 <list type="tag"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1174 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1175 <tag-name id="var_upstream_addr"><var>$upstream_addr</var></tag-name> |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1176 <tag-desc> |
966 | 1177 keeps the IP address and port of the server, |
1178 or the path to the UNIX-domain socket. | |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1179 If several servers were contacted during request processing, |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1180 their addresses are separated by commas, e.g. |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1181 “<literal>192.168.1.1:80, 192.168.1.2:80, unix:/tmp/sock</literal>”. |
966 | 1182 If an internal redirect from one server group to another happens, |
1183 initiated by | |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1184 <header>X-Accel-Redirect</header> or |
966 | 1185 <link doc="ngx_http_core_module.xml" id="error_page"/>, |
1186 then the server addresses from different groups are separated by colons, e.g. | |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1187 “<literal>192.168.1.1:80, 192.168.1.2:80, unix:/tmp/sock : 192.168.10.1:80, 192.168.10.2:80</literal>”. |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1188 </tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1189 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1190 <tag-name id="var_upstream_cache_status"><var>$upstream_cache_status</var> |
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1191 </tag-name> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1192 <tag-desc> |
966 | 1193 keeps the status of accessing a response cache (0.8.3). |
1075
6c021feec587
Removed unjustified non-breakable spaces.
Ruslan Ermilov <ru@nginx.com>
parents:
1026
diff
changeset
|
1194 The status can be either “<literal>MISS</literal>”, |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1195 “<literal>BYPASS</literal>”, “<literal>EXPIRED</literal>”, |
1011
2ad2f30efdf2
Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents:
1003
diff
changeset
|
1196 “<literal>STALE</literal>”, “<literal>UPDATING</literal>”, |
2ad2f30efdf2
Documented the "fastcgi_" and "proxy_cache_revalidate" directives.
Vladimir Homutov <vl@nginx.com>
parents:
1003
diff
changeset
|
1197 “<literal>REVALIDATED</literal>” or “<literal>HIT</literal>”. |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1198 </tag-desc> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1199 |
1186
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1200 <tag-name id="var_upstream_cookie_"><var>$upstream_cookie_</var><value>name</value> |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1201 </tag-name> |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1202 <tag-desc> |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1203 cookie with the specified <value>name</value> sent by the upstream server |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1204 in the <header>Set-Cookie</header> response header field (1.7.1). |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1205 Only the last server’s response header fields are saved. |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1206 </tag-desc> |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1207 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1208 <tag-name id="var_upstream_response_length"><var>$upstream_response_length</var> |
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1209 </tag-name> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1210 <tag-desc> |
966 | 1211 keeps the lengths of responses obtained from the upstream servers (0.7.27); |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1212 lengths are kept in bytes. |
966 | 1213 Several response lengths are separated by commas and colons |
1214 like addresses in the <var>$upstream_addr</var> variable. | |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1215 </tag-desc> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1216 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1217 <tag-name id="var_upstream_response_time"><var>$upstream_response_time</var> |
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1218 </tag-name> |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1219 <tag-desc> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1220 keeps times of responses obtained from upstream servers; |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1221 times are kept in seconds with a milliseconds resolution. |
966 | 1222 Several response times are separated by commas and colons |
1223 like addresses in the <var>$upstream_addr</var> variable. | |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1224 </tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1225 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1226 <tag-name id="var_upstream_status"><var>$upstream_status</var></tag-name> |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1227 <tag-desc> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1228 keeps codes of responses obtained from upstream servers. |
966 | 1229 Several response codes are separated by commas and colons |
1230 like addresses in the <var>$upstream_addr</var> variable. | |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1231 </tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1232 |
1186
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1233 <tag-name id="var_upstream_http_"><var>$upstream_http_</var><value>name</value></tag-name> |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1234 <tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1235 keep server response header fields. |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1236 For example, the <header>Server</header> response header field |
966 | 1237 is available through the <var>$upstream_http_server</var> variable. |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1238 The rules of converting header field names to variable names are the same |
966 | 1239 as for the variables that start with the |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1240 “<link doc="ngx_http_core_module.xml" id="variables">$http_</link>” prefix. |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1241 Only the last server’s response header fields are saved. |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1242 </tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1243 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1244 </list> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1245 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1246 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1247 </section> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1248 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1249 </module> |