Mercurial > hg > nginx-site
annotate xml/en/docs/http/ngx_http_upstream_module.xml @ 975:a57c36c82461
Donor added.
author | Maxim Konovalov <maxim@nginx.com> |
---|---|
date | Fri, 23 Aug 2013 08:01:04 +0000 |
parents | 7c542520b8f7 |
children | fc35441b4856 |
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" |
969
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
13 rev="9"> |
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"/>, | |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
21 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_pass"/>, and |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
22 <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
|
23 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
24 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
25 </section> |
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 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
28 <section id="example" name="Example Configuration"> |
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 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
31 <example> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
32 upstream <emphasis>backend</emphasis> { |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
33 server backend1.example.com weight=5; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
34 server backend2.example.com:8080; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
35 server unix:/tmp/backend3; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
36 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
37 server backup1.example.com:8080 backup; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
38 server backup2.example.com:8080 backup; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
39 } |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
40 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
41 server { |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
42 location / { |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
43 proxy_pass http://<emphasis>backend</emphasis>; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
44 } |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
45 } |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
46 </example> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
47 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
48 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
49 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
50 Dynamically configurable group, |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
51 available as part of our <commercial_version/> only: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
52 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
53 upstream <emphasis>appservers</emphasis> { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
54 zone appservers 64k; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
55 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
56 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
|
57 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
|
58 server 192.0.2.1 max_fails=3; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
59 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
60 server reserve1.example.com:8080 backup; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
61 server reserve2.example.com:8080 backup; |
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 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
64 server { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
65 location / { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
66 proxy_pass http://<emphasis>appservers</emphasis>; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
67 health_check; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
68 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
69 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
70 location /upstream_conf { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
71 upstream_conf; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
72 allow 127.0.0.1; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
73 deny all; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
74 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
75 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
76 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
77 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
78 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
79 </section> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
80 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
81 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
82 <section id="directives" name="Directives"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
83 |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
84 <directive name="upstream"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
85 <syntax block="yes"><value>name</value></syntax> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
86 <default/> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
87 <context>http</context> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
88 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
89 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
90 Defines a group of servers. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
91 Servers can listen on different ports. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
92 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
|
93 can be mixed. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
94 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
95 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
96 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
97 Example: |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
98 <example> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
99 upstream backend { |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
100 server backend1.example.com weight=5; |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
101 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
|
102 server unix:/tmp/backend3; |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
103 } |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
104 </example> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
105 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
106 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
107 <para> |
966 | 108 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
|
109 weighted round-robin balancing method. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
110 In the above example, each 7 requests will be distributed as follows: |
966 | 111 5 requests go to <literal>backend1.example.com</literal> |
112 and one request to each of the second and third servers. | |
113 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
|
114 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
|
115 servers will be tried. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
116 If a successful response could not be obtained from any of the servers, |
966 | 117 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
|
118 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
119 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
120 </directive> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
121 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
122 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
123 <directive name="server"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
124 <syntax><value>address</value> [<value>parameters</value>]</syntax> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
125 <default/> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
126 <context>upstream</context> |
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 <para> |
966 | 129 Defines the <value>address</value> and other <value>parameters</value> |
130 of a server. | |
131 The address can be specified as a domain name or IP address, | |
132 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
|
133 specified after the “<literal>unix:</literal>” prefix. |
966 | 134 If a port is not specified, the port 80 is used. |
135 A domain name that resolves to several IP addresses defines | |
136 multiple servers at once. | |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
137 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
138 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
139 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
140 The following parameters can be defined: |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
141 <list type="tag"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
142 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
143 <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
|
144 <tag-desc> |
966 | 145 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
|
146 </tag-desc> |
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>max_fails</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 number of unsuccessful attempts to communicate with the server |
151 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
|
152 parameter to consider the server unavailable for a duration also set by the |
966 | 153 <literal>fail_timeout</literal> parameter. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
154 By default, the number of unsuccessful attempts is set to 1. |
966 | 155 The zero value disables the accounting of attempts. |
942
ba3d6ade3513
Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents:
917
diff
changeset
|
156 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
|
157 <link doc="ngx_http_proxy_module.xml" id="proxy_next_upstream"/>, |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
158 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_next_upstream"/>, and |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
159 <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
|
160 directives. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
161 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
162 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
163 <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
|
164 <tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
165 sets |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
166 <list type="bullet"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
167 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
168 <listitem> |
966 | 169 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
|
170 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
|
171 </listitem> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
172 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
173 <listitem> |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
174 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
|
175 </listitem> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
176 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
177 </list> |
966 | 178 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
|
179 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
180 |
955
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
181 <tag-name><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
|
182 <tag-desc> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
183 sets the <value>time</value> during which the server will recover its weight |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
184 from zero to a nominal value, when unhealthy server becomes |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
185 <link id="health_check">healthy</link>, |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
186 or when the server becomes available after a period of time |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
187 it was considered unavailable. |
955
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
188 Default value is zero, i.e. slow start is disabled. |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
189 <note> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
190 This functionality is available as part of our <commercial_version/> only. |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
191 </note> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
192 </tag-desc> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
193 |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
194 <tag-name><literal>backup</literal></tag-name> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
195 <tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
196 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
|
197 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
|
198 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
199 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
200 <tag-name><literal>down</literal></tag-name> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
201 <tag-desc> |
968
fa19bacf6e1e
Unified upstream server up/down state terminology.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
202 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
|
203 the <link id="ip_hash"/> directive. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
204 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
205 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
206 </list> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
207 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
208 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
209 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
210 Example: |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
211 <example> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
212 upstream backend { |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
213 server backend1.example.com weight=5; |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
214 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
|
215 server unix:/tmp/backend3; |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
216 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
217 server backup1.example.com:8080 backup; |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
218 } |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
219 </example> |
969
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
220 |
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
221 <note> |
7c542520b8f7
Added note about behavior of a single server in an upstream.
Vladimir Homutov <vl@nginx.com>
parents:
968
diff
changeset
|
222 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
|
223 <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
|
224 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
|
225 </note> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
226 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
227 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
228 </directive> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
229 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
230 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
231 <directive name="zone"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
232 <syntax><value>name</value> <value>size</value></syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
233 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
234 <context>upstream</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
235 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
236 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
237 Makes the group dynamically configurable. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
238 Defines the <value>name</value> and <value>size</value> of a shared |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
239 memory zone that keeps group’s configuration and run-time state that are |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
240 shared between worker processes. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
241 Such groups allow to add, remove, and modify servers at run time. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
242 The configuration is accessible via a special location handled by |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
243 <link id="upstream_conf"/>. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
244 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
245 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
246 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
247 <note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
248 This directive is available as part of our <commercial_version/> only. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
249 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
250 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
251 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
252 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
253 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
254 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
255 <directive name="ip_hash"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
256 <syntax/> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
257 <default/> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
258 <context>upstream</context> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
259 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
260 <para> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
261 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
|
262 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
|
263 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
|
264 are used as a hashing key. |
966 | 265 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
|
266 passed to the same server except when this server is unavailable. |
966 | 267 In the latter case client requests will be passed to another server. |
268 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
|
269 <note> |
566 | 270 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
|
271 </note> |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
272 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
273 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
274 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
275 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
|
276 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
|
277 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
|
278 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
279 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
280 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
281 Example: |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
282 <example> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
283 upstream backend { |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
284 ip_hash; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
285 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
286 server backend1.example.com; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
287 server backend2.example.com; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
288 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
|
289 server backend4.example.com; |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
290 } |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
291 </example> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
292 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
293 |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
294 <para> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
295 <note> |
966 | 296 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
|
297 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
|
298 </note> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
299 </para> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
300 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
301 </directive> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
302 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
303 |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
304 <directive name="keepalive"> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
305 <syntax><value>connections</value></syntax> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
306 <default/> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
307 <context>upstream</context> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
308 <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
|
309 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
310 <para> |
966 | 311 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
|
312 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
313 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
314 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
315 The <value>connections</value> parameter sets the maximum number of |
966 | 316 idle keepalive connections to upstream servers that are preserved in |
317 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
|
318 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
|
319 are closed. |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
320 <note> |
966 | 321 It should be particularly noted that the <literal>keepalive</literal> directive |
322 does not limit the total number of connections to upstream servers | |
323 that an nginx worker process can open. | |
324 The <value>connections</value> parameter should be set to a number small enough | |
325 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
|
326 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
327 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
328 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
329 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
330 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
|
331 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
332 upstream memcached_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
333 server 127.0.0.1:11211; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
334 server 10.0.0.2:11211; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
335 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
336 keepalive 32; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
337 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
338 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
339 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
340 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
341 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
342 location /memcached/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
343 set $memcached_key $uri; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
344 memcached_pass memcached_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
345 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
346 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
347 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
348 </example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
349 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
350 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
351 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
352 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
|
353 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
|
354 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
|
355 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
356 upstream http_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
357 server 127.0.0.1:8080; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
358 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
359 keepalive 16; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
360 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
361 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
362 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
363 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
364 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
365 location /http/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
366 proxy_pass http://http_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
367 proxy_http_version 1.1; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
368 proxy_set_header Connection ""; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
369 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
370 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
371 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
372 </example> |
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 <note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
377 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
|
378 <header>Connection: Keep-Alive</header> header field to an upstream server, |
966 | 379 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
|
380 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
381 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
382 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
383 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
384 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
|
385 <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
|
386 for keepalive connections to work: |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
387 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
388 upstream fastcgi_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
389 server 127.0.0.1:9000; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
390 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
391 keepalive 8; |
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 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
395 ... |
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 location /fastcgi/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
398 fastcgi_pass fastcgi_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
399 fastcgi_keep_conn on; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
400 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
401 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
402 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
403 </example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
404 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
405 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
406 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
407 <note> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
408 When using load balancer methods other than the default |
966 | 409 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
|
410 the <literal>keepalive</literal> directive. |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
411 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
412 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
413 <note> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
414 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
|
415 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
416 </para> |
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 </directive> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
419 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
293
diff
changeset
|
420 |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
421 <directive name="least_conn"> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
422 <syntax/> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
423 <default/> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
424 <context>upstream</context> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
425 <appeared-in>1.3.1</appeared-in> |
566 | 426 <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
|
427 |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
316
diff
changeset
|
428 <para> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
429 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
|
430 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
|
431 taking into account weights of servers. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
432 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
|
433 weighted round-robin balancing method. |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
434 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
435 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
436 </directive> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
437 |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
438 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
439 <directive name="health_check"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
440 <syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
441 [<literal>interval=</literal><value>time</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
442 <!-- |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
443 [<literal>jitter=</literal><value>time</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
444 --> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
445 [<literal>fails=</literal><value>number</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
446 [<literal>passes=</literal><value>number</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
447 [<literal>uri=</literal><value>uri</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
448 [<literal>match=</literal><value>name</value>]</syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
449 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
450 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
451 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
452 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
453 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
454 Enables periodic health checks of the servers in a |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
455 <link id="upstream">group</link> referenced in the surrounding location. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
456 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
457 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
458 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
459 The following optional parameters are supported: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
460 <list type="bullet"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
461 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
462 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
463 <literal>interval</literal> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
464 sets the interval between two consecutive health checks, |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
465 by default, 5 seconds; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
466 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
467 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
468 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
469 <literal>fails</literal> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
470 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
|
471 after which this server will be considered unhealthy, |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
472 by default, 1; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
473 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
474 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
475 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
476 <literal>passes</literal> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
477 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
|
478 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
|
479 by default, 1; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
480 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
481 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
482 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
483 <literal>uri</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
484 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
|
485 by default, “<literal>/</literal>”; |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
486 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
487 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
488 <listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
489 <literal>match</literal> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
490 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
|
491 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
|
492 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
|
493 </listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
494 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
495 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
496 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
497 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
498 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
499 For example, |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
500 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
501 location / { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
502 proxy_pass http://backend; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
503 health_check; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
504 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
505 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
506 will send “<literal>/</literal>” requests to each |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
507 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
|
508 If any communication error or timeout occurs, or a |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
509 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
|
510 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
|
511 be considered unhealthy. |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
512 Client requests are not passed to unhealthy servers. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
513 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
514 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
515 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
516 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
|
517 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
|
518 and the body contents. |
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
519 Tests are configured separately using the <link id="match"/> directive |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
520 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
|
521 For example: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
522 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
523 http { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
524 server { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
525 ... |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
526 location / { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
527 proxy_pass http://backend; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
528 health_check match=welcome; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
529 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
530 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
531 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
532 match welcome { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
533 status 200; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
534 header Content-Type = text/html; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
535 body ~ "Welcome to nginx!"; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
536 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
537 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
538 </example> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
539 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
|
540 health check request should succeed, |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
541 have status 200, content type “<literal>text/html</literal>”, |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
542 and contain “<literal>Welcome to nginx!</literal>” in the body. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
543 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
544 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
545 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
546 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
|
547 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
548 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
549 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
550 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
|
551 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
|
552 considered unhealthy. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
553 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
554 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
555 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
556 <note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
557 This directive is available as part of our <commercial_version/> only. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
558 </note> |
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 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
562 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
563 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
564 <directive name="match"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
565 <syntax block="yes"><value>name</value></syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
566 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
567 <context>http</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
568 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
569 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
570 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
|
571 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
572 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
573 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
574 The following items can be tested in a response: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
575 <list type="tag"> |
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 <tag-name><literal>status 200;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
578 <tag-desc>status is 200</tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
579 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
580 <tag-name><literal>status ! 500;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
581 <tag-desc>status is not 500</tag-desc> |
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 <tag-name><literal>status 200 204;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
584 <tag-desc>status is 200 or 204</tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
585 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
586 <tag-name><literal>status ! 301 302;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
587 <tag-desc>status is neither 301 nor 302</tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
588 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
589 <tag-name><literal>status 200-399;</literal></tag-name> |
966 | 590 <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
|
591 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
592 <tag-name><literal>status ! 400-599;</literal></tag-name> |
966 | 593 <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
|
594 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
595 <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
|
596 <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
|
597 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
598 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
599 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
600 <list type="tag"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
601 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
602 <tag-name><literal>header Content-Type = text/html;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
603 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
604 header contains <header>Content-Type</header> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
605 with value <literal>text/html</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
606 </tag-desc> |
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 <tag-name><literal>header Content-Type != text/html;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
609 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
610 header contains <header>Content-Type</header> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
611 with value other than <literal>text/html</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
612 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
613 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
614 <tag-name><literal>header Connection ~ close;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
615 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
616 header contains <header>Connection</header> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
617 with value matching regular expression <literal>close</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
618 </tag-desc> |
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 <tag-name><literal>header Connection !~ close;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
621 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
622 header contains <header>Connection</header> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
623 with value not matching regular expression <literal>close</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
624 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
625 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
626 <tag-name><literal>header Host;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
627 <tag-desc>header contains <header>Host</header></tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
628 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
629 <tag-name><literal>header ! X-Accel-Redirect;</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
630 <tag-desc>header lacks <header>X-Accel-Redirect</header></tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
631 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
632 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
633 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
634 <list type="tag"> |
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>body ~ "Welcome to nginx!";</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
637 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
638 body matches regular expression “<literal>Welcome to nginx!</literal>” |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
639 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
640 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
641 <tag-name><literal>body !~ "Welcome to nginx!";</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
642 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
643 body does not match regular expression “<literal>Welcome to nginx!</literal>” |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
644 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
645 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
646 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
647 </para> |
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 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
650 If several tests are specified, |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
651 the response matches only if it matches all tests. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
652 <note> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
653 Only the first 256k of the response body are examined. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
654 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
655 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
656 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
657 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
658 Examples: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
659 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
660 # status is 200, content type is "text/html", |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
661 # and body contains "Welcome to nginx!" |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
662 match welcome { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
663 status 200; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
664 header Content-Type = text/html; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
665 body ~ "Welcome to nginx!"; |
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 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
668 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
669 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
670 # 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
|
671 match not_redirect { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
672 status ! 301-303 307; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
673 header ! Refresh; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
674 } |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
675 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
676 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
677 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
678 # status ok and not in maintenance mode |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
679 match server_ok { |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
680 status 200-399; |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
681 body !~ "maintenance mode"; |
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 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
684 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
685 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
686 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
687 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
688 <note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
689 This directive is available as part of our <commercial_version/> only. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
690 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
691 </para> |
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 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
694 |
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 <directive name="sticky_cookie_insert"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
697 <syntax><value>name</value> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
698 [<literal>expires=</literal><value>time</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
699 [<literal>domain=</literal><value>host</value>] |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
700 [<literal>path=</literal><value>path</value>]</syntax> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
701 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
702 <context>upstream</context> |
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> |
962
f3754c623e6b
Minor editing of the stiky_cookie_insert directive.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
960
diff
changeset
|
705 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
|
706 passed to the same server in a group of servers. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
707 Example: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
708 <example> |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
709 upstream backend { |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
710 server backend1.example.com; |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
711 server backend2.example.com; |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
712 |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
713 sticky_cookie_insert srv_id expires=1h domain=example.com path=/; |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
714 } |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
715 </example> |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
716 </para> |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
717 |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
718 <para> |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
719 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
|
720 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
|
721 Further requests from the same client are passed to the same server. |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
722 If a request cannot be processed by the bound server, the new server |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
723 is selected as if the client was not yet bound. |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
724 </para> |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
725 |
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
726 <para> |
962
f3754c623e6b
Minor editing of the stiky_cookie_insert directive.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
960
diff
changeset
|
727 Information about the bound server is kept in an HTTP cookie. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
728 The first parameter sets the name of the cookie to be inserted or inspected. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
729 Additional parameters may be as follows: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
730 <list type="tag"> |
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 <tag-name><literal>expires</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
733 <tag-desc> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
734 Sets the time for which a browser should keep the cookie. |
960
48ab154edf10
Upstream: removed obsoleted directives in the "sticky" module.
Vladimir Homutov <vl@nginx.com>
parents:
956
diff
changeset
|
735 The parameter <literal>max</literal> will cause the cookie to expire on |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
736 “<literal>31 Dec 2037 23:55:55 GMT</literal>”. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
737 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
|
738 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
|
739 the end of a browser session. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
740 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
741 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
742 <tag-name><literal>domain</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
743 <tag-desc> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
744 Defines the domain for which the cookie is set. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
745 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
746 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
747 <tag-name><literal>path</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
748 <tag-desc> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
749 Defines the path for which the cookie is set. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
750 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
751 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
752 </list> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
753 If some parameter is omitted, the corresponding cookie field is not set. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
754 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
755 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
756 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
757 <note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
758 This directive is available as part of our <commercial_version/> only. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
759 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
760 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
761 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
762 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
763 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
764 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
765 <directive name="upstream_conf"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
766 <syntax/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
767 <default/> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
768 <context>location</context> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
769 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
770 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
771 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
|
772 location. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
773 Access to this location should be |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
774 <link doc="ngx_http_core_module.xml" id="satisfy">limited</link>. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
775 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
776 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
777 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
778 Configuration commands can be used to: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
779 <list type="bullet"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
780 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
781 <listitem>view all primary or backup servers in a group;</listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
782 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
783 <listitem>view an individual server;</listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
784 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
785 <listitem>modify an individual server;</listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
786 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
787 <listitem>add a new server (see the note below);</listitem> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
788 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
789 <listitem>remove an individual server.</listitem> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
790 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
791 </list> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
792 <note> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
793 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
|
794 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
|
795 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
|
796 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
|
797 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
|
798 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
799 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
800 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
801 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
802 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
|
803 for example: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
804 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
805 http://127.0.0.1/upstream_conf?upstream=appservers |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
806 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
807 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
808 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
809 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
810 The following parameters are supported: |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
811 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
812 <list type="tag" compact="no"> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
813 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
814 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
815 <literal>upstream=</literal><value>name</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
816 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
817 Selects a group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
818 This parameter is mandatory. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
819 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
820 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
821 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
822 <literal>backup=</literal> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
823 </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 If not set, selects primary servers in the group. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
826 If set, selects backup servers in the group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
827 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
828 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
829 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
830 <literal>id=</literal><value>number</value></tag-name> |
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 Selects an individual primary or backup server in the group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
833 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
834 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
835 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
836 <literal>remove=</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
837 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
838 Removes an individual primary or backup server from the group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
839 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
840 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
841 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
842 <literal>add=</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
843 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
844 Adds a new primary or backup server to the group. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
845 </tag-desc> |
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 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
848 <literal>server=</literal><value>address</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
849 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
850 Same as the “<literal>address</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
851 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
852 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
853 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
854 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
855 <literal>weight=</literal><value>number</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
856 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
857 Same as the “<literal>weight</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
858 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
859 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
860 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
861 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
862 <literal>max_fails=</literal><value>number</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
863 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
864 Same as the “<literal>max_fails</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
865 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
866 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
867 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
868 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
869 <literal>fail_timeout=</literal><value>time</value></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
870 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
871 Same as the “<literal>fail_timeout</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
872 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
873 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
874 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
875 <tag-name> |
955
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
876 <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
|
877 <tag-desc> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
878 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
|
879 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
|
880 </tag-desc> |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
881 |
28d580f1eb63
Documented the "slow_start" parameter of the upstream "server" directive.
Vladimir Homutov <vl@nginx.com>
parents:
953
diff
changeset
|
882 <tag-name> |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
883 <literal>down=</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
884 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
885 Same as the “<literal>down</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
886 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
887 </tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
888 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
889 <tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
890 <literal>up=</literal></tag-name> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
891 <tag-desc> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
892 The opposite of the “<literal>down</literal>” parameter |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
893 of the <link id="server"/> directive. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
894 </tag-desc> |
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 </list> |
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 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
|
899 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
|
900 target. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
901 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
902 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
903 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
904 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
|
905 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
906 http://127.0.0.1/upstream_conf?upstream=appservers |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
907 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
908 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
909 To view the backup servers in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
910 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
911 http://127.0.0.1/upstream_conf?upstream=appservers&backup= |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
912 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
913 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
914 To view an individual primary server in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
915 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
916 http://127.0.0.1/upstream_conf?upstream=appservers&id=42 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
917 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
918 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
919 To view an individual backup server in the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
920 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
921 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
|
922 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
923 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
924 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
925 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
926 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
|
927 specify its address in the “<literal>server=</literal>” parameter. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
928 Without other parameters specified, a server will be added with other |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
929 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
|
930 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
931 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
932 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
933 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
|
934 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
935 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
|
936 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
937 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
938 To add a new backup server to the group, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
939 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
940 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
|
941 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
942 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
943 To add a new primary server to the group, |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
944 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
|
945 and mark it as “<literal>down</literal>”, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
946 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
947 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
|
948 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
949 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
950 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
951 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
952 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
|
953 select it with the <literal>id=</literal> parameter. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
954 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
955 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
956 <para> |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
957 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
|
958 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
959 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
|
960 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
961 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
962 To remove an individual backup server from the group, send: |
953
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 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
|
965 </example> |
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 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
968 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
969 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
|
970 select it with the <literal>id=</literal> parameter. |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
971 </para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
972 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
973 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
974 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
|
975 by marking it as “<literal>down</literal>”, send: |
953
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
976 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
977 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
|
978 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
979 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
980 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
|
981 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
982 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
|
983 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
984 |
956
488a3f738db0
Text revision of commercial modules.
Egor Nikitin <yegor.nikitin@gmail.com>
parents:
955
diff
changeset
|
985 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
|
986 <example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
987 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
|
988 </example> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
989 |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
990 </para> |
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 <para> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
993 <note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
994 This directive is available as part of our <commercial_version/> only. |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
995 </note> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
996 </para> |
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 </directive> |
aded7086e84f
Commercial version documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
942
diff
changeset
|
999 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1000 </section> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1001 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1002 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1003 <section id="variables" name="Embedded Variables"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1004 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1005 <para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1006 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
|
1007 supports the following embedded variables: |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1008 <list type="tag"> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1009 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1010 <tag-name><var>$upstream_addr</var></tag-name> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1011 <tag-desc> |
966 | 1012 keeps the IP address and port of the server, |
1013 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
|
1014 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
|
1015 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
|
1016 “<literal>192.168.1.1:80, 192.168.1.2:80, unix:/tmp/sock</literal>”. |
966 | 1017 If an internal redirect from one server group to another happens, |
1018 initiated by | |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1019 <header>X-Accel-Redirect</header> or |
966 | 1020 <link doc="ngx_http_core_module.xml" id="error_page"/>, |
1021 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
|
1022 “<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
|
1023 </tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1024 |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1025 <tag-name><var>$upstream_cache_status</var></tag-name> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1026 <tag-desc> |
966 | 1027 keeps the status of accessing a response cache (0.8.3). |
1028 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
|
1029 “<literal>BYPASS</literal>”, “<literal>EXPIRED</literal>”, |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1030 “<literal>STALE</literal>”, “<literal>UPDATING</literal>” or |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1031 “<literal>HIT</literal>”. |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1032 </tag-desc> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1033 |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1034 <tag-name><var>$upstream_response_length</var></tag-name> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1035 <tag-desc> |
966 | 1036 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
|
1037 lengths are kept in bytes. |
966 | 1038 Several response lengths are separated by commas and colons |
1039 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
|
1040 </tag-desc> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1041 |
293
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1042 <tag-name><var>$upstream_response_time</var></tag-name> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1043 <tag-desc> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1044 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
|
1045 times are kept in seconds with a milliseconds resolution. |
966 | 1046 Several response times are separated by commas and colons |
1047 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
|
1048 </tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1049 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1050 <tag-name><var>$upstream_status</var></tag-name> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1051 <tag-desc> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1052 keeps codes of responses obtained from upstream servers. |
966 | 1053 Several response codes are separated by commas and colons |
1054 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
|
1055 </tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1056 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1057 <tag-name><var>$upstream_http_...</var></tag-name> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1058 <tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1059 keep server response header fields. |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1060 For example, the <header>Server</header> response header field |
966 | 1061 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
|
1062 The rules of converting header field names to variable names are the same |
966 | 1063 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
|
1064 “<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
|
1065 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
|
1066 </tag-desc> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1067 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1068 </list> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1069 </para> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1070 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1071 </section> |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1072 |
34246e706f48
English translation of the ngx_http_upstream_module documentation.
Ruslan Ermilov <ru@nginx.com>
parents:
diff
changeset
|
1073 </module> |