Mercurial > hg > nginx-site
annotate xml/ru/docs/http/ngx_http_upstream_module.xml @ 1242:935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 24 Jun 2014 16:46:28 +0400 |
parents | 2246339a6a93 |
children | 831215432a4f |
rev | line source |
---|---|
222
bfe3eff81d04
Removed redundant encoding specification.
Ruslan Ermilov <ru@nginx.com>
parents:
135
diff
changeset
|
1 <?xml version="1.0"?> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
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 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 |
292 | 10 <module name="Модуль ngx_http_upstream_module" |
135
edf8c90f8085
Renamed ngx_http_upstream to ngx_http_upstream_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
11 link="/ru/docs/http/ngx_http_upstream_module.html" |
589 | 12 lang="ru" |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
13 rev="6"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 |
110
40eec261c2a6
Added proper support for anonymous sections, notably for the summary.
Ruslan Ermilov <ru@nginx.com>
parents:
108
diff
changeset
|
15 <section id="summary"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 <para> |
292 | 18 Модуль <literal>ngx_http_upstream_module</literal> |
19 позволяет описывать группы серверов, | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 которые могут использоваться в директивах |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
21 <link doc="ngx_http_proxy_module.xml" id="proxy_pass"/>, |
1181 | 22 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_pass"/>, |
1194 | 23 <link doc="ngx_http_uwsgi_module.xml" id="uwsgi_pass"/>, |
1181 | 24 <link doc="ngx_http_scgi_module.xml" id="scgi_pass"/> и |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
25 <link doc="ngx_http_memcached_module.xml" id="memcached_pass"/>. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 |
292 | 31 <section id="example" name="Пример конфигурации"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 <example> |
292 | 35 upstream <emphasis>backend</emphasis> { |
36 server backend1.example.com weight=5; | |
37 server backend2.example.com:8080; | |
38 server unix:/tmp/backend3; | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 |
292 | 40 server backup1.example.com:8080 backup; |
41 server backup2.example.com:8080 backup; | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 } |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
44 server { |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
45 location / { |
292 | 46 proxy_pass http://<emphasis>backend</emphasis>; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
47 } |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 } |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
50 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 |
1242
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
52 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
53 Динамически настраиваемая группа, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
54 доступна как часть |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
55 <commercial_version>коммерческой подписки</commercial_version>: |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
56 <example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
57 upstream <emphasis>appservers</emphasis> { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
58 zone appservers 64k; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
59 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
60 server appserv1.example.com weight=5; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
61 server appserv2.example.com:8080 fail_timeout=5s slow_start=30s; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
62 server 192.0.2.1 max_fails=3; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
63 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
64 server reserve1.example.com:8080 backup; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
65 server reserve2.example.com:8080 backup; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
66 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
67 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
68 server { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
69 location / { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
70 proxy_pass http://<emphasis>appservers</emphasis>; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
71 health_check; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
72 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
73 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
74 location /upstream_conf { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
75 upstream_conf; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
76 allow 127.0.0.1; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
77 deny all; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
78 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
79 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
80 </example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
81 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
82 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
85 |
292 | 86 <section id="directives" name="Директивы"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
87 |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
88 <directive name="upstream"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
89 <syntax block="yes"><value>название</value></syntax> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
90 <default/> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
91 <context>http</context> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
92 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
93 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
94 Описывает группу серверов. |
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 Кроме того, можно одновременно использовать серверы, |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
97 слушающие на TCP- и UNIX-сокетах. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
98 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
99 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
100 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
101 Пример: |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
102 <example> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
103 upstream backend { |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
104 server backend1.example.com weight=5; |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
105 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
|
106 server unix:/tmp/backend3; |
1126
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
107 |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
108 server backup1.example.com backup; |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
109 } |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
110 </example> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
111 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
112 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
113 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
114 По умолчанию запросы распределяются по серверам циклически |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
115 (в режиме round-robin) с учётом весов серверов. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
116 В вышеприведённом примере каждые 7 запросов будут распределены так: |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
117 5 запросов на <literal>backend1.example.com</literal> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
118 и по одному запросу на второй и третий серверы. |
966 | 119 Если при попытке работы с сервером происходит ошибка, то запрос |
120 передаётся следующему серверу, и так далее до тех пор, пока не будут опробованы | |
533
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 ни от одного из серверов, то клиенту будет возвращён результат работы |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
124 с последним сервером. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
125 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
126 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
127 </directive> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
128 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
129 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
130 <directive name="server"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
131 <syntax><value>адрес</value> [<value>параметры</value>]</syntax> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
132 <default/> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
133 <context>upstream</context> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
134 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
135 <para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
136 Задаёт <value>адрес</value> и другие <value>параметры</value> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
137 сервера. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
138 Адрес может быть указан в виде доменного имени или IP-адреса, |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
139 и необязательного порта, или в виде пути UNIX-сокета, который |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
140 указывается после префикса “<literal>unix:</literal>”. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
141 Если порт не указан, используется порт 80. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
142 Доменное имя, которому соответствует несколько IP-адресов, |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
143 задаёт сразу несколько серверов. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
144 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
145 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
146 <para> |
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 <list type="tag"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
149 |
1241
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
150 <tag-name id="weight"> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
151 <literal>weight</literal>=<value>число</value> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
152 </tag-name> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
153 <tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
154 задаёт вес сервера, по умолчанию 1. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
155 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
156 |
1241
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
157 <tag-name id="max_fails"> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
158 <literal>max_fails</literal>=<value>число</value> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
159 </tag-name> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
160 <tag-desc> |
966 | 161 задаёт число неудачных попыток работы с сервером, которые должны произойти |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
162 в течение времени, заданного параметром <literal>fail_timeout</literal>, |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
163 чтобы сервер считался недоступным на период времени, также заданный |
966 | 164 параметром <literal>fail_timeout</literal>. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
165 По умолчанию число попыток устанавливается равным 1. |
966 | 166 Нулевое значение отключает учёт попыток. |
942
ba3d6ade3513
Elaborate on upstream server failures.
Ruslan Ermilov <ru@nginx.com>
parents:
917
diff
changeset
|
167 Что считается неудачной попыткой, определяется директивами |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
168 <link doc="ngx_http_proxy_module.xml" id="proxy_next_upstream"/>, |
1181 | 169 <link doc="ngx_http_fastcgi_module.xml" id="fastcgi_next_upstream"/>, |
1194 | 170 <link doc="ngx_http_uwsgi_module.xml" id="uwsgi_next_upstream"/>, |
1181 | 171 <link doc="ngx_http_scgi_module.xml" id="scgi_next_upstream"/> и |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
172 <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
|
173 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
174 |
1241
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
175 <tag-name id="fail_timeout"> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
176 <literal>fail_timeout</literal>=<value>время</value> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
177 </tag-name> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
178 <tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
179 задаёт |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
180 <list type="bullet"> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
181 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
182 <listitem> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
183 время, в течение которого должно произойти заданное число неудачных |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
184 попыток работы с сервером для того, чтобы сервер считался недоступным; |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
185 </listitem> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
186 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
187 <listitem> |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
188 и время, в течение которого сервер будет считаться недоступным. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
189 </listitem> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
190 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
191 </list> |
966 | 192 По умолчанию параметр равен 10 секундам. |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
193 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
194 |
1241
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
195 <tag-name id="backup"> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
196 <literal>backup</literal> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
197 </tag-name> |
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 На него будут передаваться запросы в случае, если не работают основные серверы. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
201 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
202 |
1241
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
203 <tag-name id="down"> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
204 <literal>down</literal> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
205 </tag-name> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
206 <tag-desc> |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
207 помечает сервер как постоянно недоступный; используется |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
208 совместно с директивой <link id="ip_hash"/>. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
209 </tag-desc> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
210 |
1126
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
211 </list> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
212 </para> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
213 |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
214 <para> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
215 Кроме того, |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
216 следующие параметры доступны как часть |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
217 <commercial_version>коммерческой подписки</commercial_version>: |
1126
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
218 <list type="tag"> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
219 |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
220 <tag-name id="max_conns"> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
221 <literal>max_conns</literal>=<value>число</value> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
222 </tag-name> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
223 <tag-desc> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
224 ограничивает максимальное <value>число</value> одновременных соединений |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
225 к проксируемому серверу (1.5.9). |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
226 Значение по умолчанию равно 0 и означает, что ограничения нет. |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
227 </tag-desc> |
2e28d1c4a0a2
Upstream: revised layout of the "server" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1125
diff
changeset
|
228 |
1124
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
229 <tag-name id="resolve"> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
230 <literal>resolve</literal> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
231 </tag-name> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
232 <tag-desc> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
233 отслеживает изменения IP-адресов, соответствующих доменному имени сервера, |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
234 и автоматически изменяет конфигурацию группы |
1127
948c853f5d22
Upstream: improved "server resolve".
Ruslan Ermilov <ru@nginx.com>
parents:
1126
diff
changeset
|
235 без необходимости перезапуска nginx (1.5.12). |
1124
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
236 <para> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
237 Для работы этого параметра |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
238 директива <link doc="ngx_http_core_module.xml" id="resolver"/> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
239 должна быть задана в блоке |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
240 <link doc="ngx_http_core_module.xml" id="http"/>. |
1127
948c853f5d22
Upstream: improved "server resolve".
Ruslan Ermilov <ru@nginx.com>
parents:
1126
diff
changeset
|
241 Пример: |
1124
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
242 <example> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
243 http { |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
244 resolver 10.0.0.1; |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
245 |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
246 upstream u { |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
247 zone ...; |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
248 ... |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
249 server example.com resolve; |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
250 } |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
251 } |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
252 </example> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
253 </para> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
254 </tag-desc> |
d790333947f4
Upstream: the "resolve" parameter of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1123
diff
changeset
|
255 |
1241
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
256 <tag-name id="route"> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
257 <literal>route</literal>=<value>строка</value> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
258 </tag-name> |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
259 <tag-desc> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
260 задаёт имя маршрута к серверу. |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
261 </tag-desc> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
262 |
1241
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
263 <tag-name id="slow_start"> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
264 <literal>slow_start</literal>=<value>время</value> |
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
265 </tag-name> |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
266 <tag-desc> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
267 задаёт <value>время</value>, в течение которого вес сервера |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
268 восстановится от нуля до своего номинального значения в ситуации, когда |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
269 неработоспособный (unhealthy) сервер вновь становится работоспособным |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
270 (<link id="health_check">healthy</link>) |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
271 или когда сервер становится доступным по прошествии времени, |
1241
2246339a6a93
Upstream: added IDs for "server" and "health_check" params.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1240
diff
changeset
|
272 в течение которого он считался <link id="fail_timeout">недоступным</link>. |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
273 Значение по умолчанию равно нулю и означает, что медленный старт выключен. |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
274 </tag-desc> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
275 |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
276 </list> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
277 </para> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
278 |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
279 <para> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
280 <note> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
281 Если в группе только один сервер, параметры <literal>max_fails</literal>, |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
282 <literal>fail_timeout</literal> и <literal>slow_start</literal> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
283 игнорируются и такой сервер никогда не будет считаться недоступным. |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
284 </note> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
285 </para> |
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
286 |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
287 </directive> |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
288 |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
289 |
1123
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
290 <directive name="zone"> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
291 <syntax><value>имя</value> <value>размер</value></syntax> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
292 <default/> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
293 <context>upstream</context> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
294 |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
295 <para> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
296 Задаёт <value>имя</value> и <value>размер</value> зоны разделяемой памяти, |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
297 в которой хранятся конфигурация группы и рабочее состояние, |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
298 разделяемые между рабочими процессами. |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
299 В таких группах возможно изменение состава группы или |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
300 настроек отдельных серверов без необходимости перезапуска nginx. |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
301 Конфигурация доступна через специальный location, |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
302 для которого указана директива <link id="upstream_conf"/>. |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
303 </para> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
304 |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
305 <para> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
306 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
307 Эта директива доступна как часть |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
308 <commercial_version>коммерческой подписки</commercial_version>. |
1123
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
309 </note> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
310 </para> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
311 |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
312 </directive> |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
313 |
9a9aa8e9d12c
Rephrased the "zone" directive, translated into Russian.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1122
diff
changeset
|
314 |
1230
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
315 <directive name="hash"> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
316 <syntax><value>ключ</value> [<literal>consistent</literal>]</syntax> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
317 <default/> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
318 <context>upstream</context> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
319 <appeared-in>1.7.2</appeared-in> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
320 |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
321 <para> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
322 Задаёт метод балансировки нагрузки для группы, при котором |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
323 соответствие клиента серверу определяется при помощи |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
324 хэшированного значения <value>ключа</value>. |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
325 В качестве <value>ключа</value> может использоваться |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
326 текст, переменные и их комбинации. |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
327 Следует отметить, что любое добавление или удаление серверов в группе |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
328 может привести к перераспределению большинства ключей на другие серверы. |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
329 Метод совместим с библиотекой Perl |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
330 <link url="http://search.cpan.org/perldoc?Cache%3A%3AMemcached">Cache::Memcached</link>. |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
331 </para> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
332 |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
333 <para> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
334 Если задан параметр <literal>consistent</literal>, то вместо |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
335 вышеописанного метода будет использоваться метод консистентного хэширования |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
336 <link url="http://www.last.fm/user/RJ/journal/2007/04/10/392555/">ketama</link>. |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
337 Метод гарантирует, что при добавлении сервера в группу или его удалении |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
338 на другие серверы будет перераспределено минимальное число ключей. |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
339 Применение метода для кэширующих серверов обеспечивает |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
340 больший процент попаданий в кэш. |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
341 Метод совместим с библиотекой Perl |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
342 <link url="http://search.cpan.org/perldoc?Cache%3A%3AMemcached%3A%3AFast">Cache::Memcached::Fast</link> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
343 при значении параметра <value>ketama_points</value> равным 160. |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
344 </para> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
345 |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
346 </directive> |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
347 |
6cc809881694
Upstream: added the "hash" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1194
diff
changeset
|
348 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
349 <directive name="ip_hash"> |
102
c76a257f3fd4
The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents:
99
diff
changeset
|
350 <syntax/> |
99
1d315ef37215
The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents:
79
diff
changeset
|
351 <default/> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
352 <context>upstream</context> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
353 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
354 <para> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
355 Задаёт для группы метод балансировки нагрузки, при котором запросы |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
356 распределяются по серверам на основе IP-адресов клиентов. |
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
357 В качестве ключа для хэширования используются первые три |
542
a9e6a8613534
Documented IPv6 support in ip_hash.
Ruslan Ermilov <ru@nginx.com>
parents:
533
diff
changeset
|
358 октета IPv4-адреса клиента или IPv6-адрес клиента целиком. |
292 | 359 Метод гарантирует, что запросы одного и того же клиента |
360 будут всегда передаваться на один и тот же сервер. | |
1240
019f8273ee24
Upstream: translated the missing parts of the "server" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1238
diff
changeset
|
361 Если же этот сервер будет считаться недоступным, |
292 | 362 то запросы этого клиента будут передаваться на другой сервер. |
363 С большой долей вероятности это также будет один и тот же сервер. | |
542
a9e6a8613534
Documented IPv6 support in ip_hash.
Ruslan Ermilov <ru@nginx.com>
parents:
533
diff
changeset
|
364 <note> |
566 | 365 IPv6-адреса поддерживаются начиная с версий 1.3.2 и 1.2.2. |
542
a9e6a8613534
Documented IPv6 support in ip_hash.
Ruslan Ermilov <ru@nginx.com>
parents:
533
diff
changeset
|
366 </note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
367 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
368 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
369 <para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
370 Если один из серверов нужно убрать на некоторое время, то для сохранения |
292 | 371 текущего хэширования IP-адресов клиентов этот сервер нужно пометить |
372 параметром <literal>down</literal>. | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
373 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
374 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
375 <para> |
292 | 376 Пример: |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
377 <example> |
292 | 378 upstream backend { |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
379 ip_hash; |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
380 |
292 | 381 server backend1.example.com; |
382 server backend2.example.com; | |
383 server backend3.example.com <emphasis>down</emphasis>; | |
384 server backend4.example.com; | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
385 } |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
386 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
387 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
388 |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
389 <para> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
390 <note> |
566 | 391 До версий 1.3.1 и 1.2.2 для серверов, использующих метод балансировки нагрузки |
526
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
392 <literal>ip_hash</literal>, нельзя было задать вес. |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
393 </note> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
394 </para> |
4f907cde0382
1.3.1 changes: ip_hash+weight, least_conn.
Ruslan Ermilov <ru@nginx.com>
parents:
367
diff
changeset
|
395 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
396 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
397 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
398 |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
399 <directive name="keepalive"> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
400 <syntax><value>соединения</value></syntax> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
401 <default/> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
402 <context>upstream</context> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
403 <appeared-in>1.1.4</appeared-in> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
404 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
405 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
406 Задействует кэш соединений для группы серверов. |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
407 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
408 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
409 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
410 Параметр <value>соединения</value> устанавливает максимальное число |
654
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
411 неактивных постоянных соединений с серверами группы, которые будут |
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
412 сохраняться в кэше каждого рабочего процесса. |
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
413 При превышении этого числа наиболее давно не используемые соединения |
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
414 закрываются. |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
415 <note> |
654
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
416 Следует особо отметить, что директива <literal>keepalive</literal> |
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
417 не ограничивает общее число соединений с серверами группы, которые |
841118e33f41
Refined the text about cache of connections to upstream servers.
Ruslan Ermilov <ru@nginx.com>
parents:
589
diff
changeset
|
418 рабочие процессы nginx могут открыть. |
966 | 419 Параметр <value>соединения</value> следует устанавливать достаточно |
420 консервативно, чтобы серверы группы по-прежнему могли обрабатывать | |
421 новые входящие соединения. | |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
422 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
423 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
424 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
425 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
426 Пример конфигурации группы серверов memcached с постоянными соединениями: |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
427 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
428 upstream memcached_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
429 server 127.0.0.1:11211; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
430 server 10.0.0.2:11211; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
431 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
432 keepalive 32; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
433 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
434 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
435 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
436 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
437 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
438 location /memcached/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
439 set $memcached_key $uri; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
440 memcached_pass memcached_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
441 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
442 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
443 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
444 </example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
445 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
446 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
447 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
448 Для HTTP директиву |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
449 <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:
292
diff
changeset
|
450 следует установить в “<literal>1.1</literal>”, |
367
f4033b9bc4ec
- Removed unnecessary instances of unbreakable space.
Ruslan Ermilov <ru@nginx.com>
parents:
325
diff
changeset
|
451 а поле заголовка <header>Connection</header> — очистить: |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
452 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
453 upstream http_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
454 server 127.0.0.1:8080; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
455 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
456 keepalive 16; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
457 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
458 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
459 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
460 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
461 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
462 location /http/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
463 proxy_pass http://http_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
464 proxy_http_version 1.1; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
465 proxy_set_header Connection ""; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
466 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
467 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
468 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
469 </example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
470 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
471 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
472 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
473 <note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
474 Хоть это и не рекомендуется, но также возможно использование постоянных |
966 | 475 соединений с HTTP/1.0, путём передачи поля заголовка |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
476 <header>Connection: Keep-Alive</header> серверу группы. |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
477 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
478 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
479 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
480 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
481 Для работы постоянных соединений с FastCGI-серверами потребуется |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
482 включить директиву |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
483 <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:
292
diff
changeset
|
484 <example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
485 upstream fastcgi_backend { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
486 server 127.0.0.1:9000; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
487 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
488 keepalive 8; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
489 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
490 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
491 server { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
492 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
493 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
494 location /fastcgi/ { |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
495 fastcgi_pass fastcgi_backend; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
496 fastcgi_keep_conn on; |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
497 ... |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
498 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
499 } |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
500 </example> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
501 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
502 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
503 <para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
504 <note> |
533
fb630c3c5039
Revamped the upstream documentation somewhat.
Ruslan Ermilov <ru@nginx.com>
parents:
526
diff
changeset
|
505 При использовании методов балансировки нагрузки, отличных |
316
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
506 от стандартного round-robin, следует активировать их до |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
507 директивы <literal>keepalive</literal>. |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
508 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
509 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
510 <note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
511 Протоколы SCGI и uwsgi не определяют семантику постоянных соединений. |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
512 </note> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
513 </para> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
514 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
515 </directive> |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
516 |
1fb1c077658b
Documented the following directives: "keepalive", "proxy_http_version",
Ruslan Ermilov <ru@nginx.com>
parents:
292
diff
changeset
|
517 |
1125
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
518 <directive name="least_conn"> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
519 <syntax/> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
520 <default/> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
521 <context>upstream</context> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
522 <appeared-in>1.3.1</appeared-in> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
523 <appeared-in>1.2.2</appeared-in> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
524 |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
525 <para> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
526 Задаёт для группы метод балансировки нагрузки, при котором запрос |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
527 передаётся серверу с наименьшим числом активных соединений, |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
528 с учётом весов серверов. |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
529 Если подходит сразу несколько серверов, они выбираются циклически |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
530 (в режиме round-robin) с учётом их весов. |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
531 </para> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
532 |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
533 </directive> |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
534 |
9a95b9026a16
Upstream: reallocated the "queue" directive.
Ruslan Ermilov <ru@nginx.com>
parents:
1124
diff
changeset
|
535 |
1242
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
536 <directive name="health_check"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
537 <syntax>[<value>параметры</value>]</syntax> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
538 <default/> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
539 <context>location</context> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
540 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
541 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
542 Активирует периодические проверки работоспособности серверов в |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
543 <link id="upstream">группе</link>, указанной в содержащем location. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
544 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
545 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
546 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
547 Могут быть заданы следующие необязательные параметры: |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
548 <list type="tag"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
549 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
550 <tag-name id="interval"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
551 <literal>interval</literal>=<value>время</value> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
552 </tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
553 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
554 задаёт интервал между двумя последовательными проверками, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
555 по умолчанию 5 секунд; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
556 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
557 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
558 <tag-name id="fails"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
559 <literal>fails</literal>=<value>число</value> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
560 </tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
561 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
562 задаёт число последовательных неуспешных проверок для определённого сервера, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
563 после которых сервер будет считаться неработоспособным, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
564 по умолчанию 1; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
565 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
566 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
567 <tag-name id="passes"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
568 <literal>passes</literal>=<value>число</value> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
569 </tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
570 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
571 задаёт число последовательных успешных проверок для определённого сервера, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
572 после которых сервер будет считаться работоспособным, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
573 по умолчанию 1; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
574 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
575 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
576 <tag-name id="uri"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
577 <literal>uri</literal>=<value>uri</value> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
578 </tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
579 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
580 задаёт URI, используемый в запросах, проверяющих работоспособность, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
581 по умолчанию “<literal>/</literal>”; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
582 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
583 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
584 <tag-name id="hc_match"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
585 <literal>match</literal>=<value>имя</value> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
586 </tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
587 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
588 указывает на блок <literal>match</literal> с условиями, которым должен |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
589 удовлетворять ответ, чтобы результат проверки считался успешным; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
590 по умолчанию код ответа должен быть 2xx или 3xx. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
591 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
592 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
593 </list> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
594 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
595 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
596 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
597 В примере |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
598 <example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
599 location / { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
600 proxy_pass http://backend; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
601 health_check; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
602 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
603 </example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
604 каждому серверу группы <literal>backend</literal> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
605 с интервалом в 5 секунд посылаются запросы “<literal>/</literal>”. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
606 Если происходит ошибка или таймаут при работе с сервером, или |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
607 код ответа проксируемого сервера не равен |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
608 2xx или 3xx, проверка считается неуспешной и сервер |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
609 признаётся неработоспособным. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
610 На неработоспособные серверы клиентские запросы передаваться не будут. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
611 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
612 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
613 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
614 Проверки работоспособности могут тестировать код ответа, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
615 наличие или отсутствие определённых полей заголовка и их значений, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
616 а также содержимое тела ответа. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
617 Тесты настраиваются отдельно при помощи директивы <link id="match"/> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
618 и указываются в параметре <literal>match</literal>. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
619 Например: |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
620 <example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
621 http { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
622 server { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
623 ... |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
624 location / { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
625 proxy_pass http://backend; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
626 health_check match=welcome; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
627 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
628 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
629 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
630 match welcome { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
631 status 200; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
632 header Content-Type = text/html; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
633 body ~ "Welcome to nginx!"; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
634 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
635 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
636 </example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
637 В такой конфигурации успешный ответ на проверочный запрос |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
638 должен иметь код 200, тип содержимого “<literal>text/html</literal>” |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
639 и “<literal>Welcome to nginx!</literal>” в теле ответа. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
640 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
641 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
642 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
643 Группа должна находиться в <link id="zone">зоне разделяемой памяти</link>. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
644 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
645 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
646 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
647 Если для группы задано несколько проверок, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
648 то при любой неуспешной проверке соответствующий сервер будет |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
649 считаться неработоспособным. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
650 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
651 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
652 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
653 <note> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
654 Эта директива доступна как часть |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
655 <commercial_version>коммерческой подписки</commercial_version>. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
656 </note> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
657 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
658 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
659 </directive> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
660 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
661 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
662 <directive name="match"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
663 <syntax block="yes"><value>имя</value></syntax> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
664 <default/> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
665 <context>http</context> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
666 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
667 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
668 Задаёт именованный набор тестов для анализа ответов |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
669 на запросы проверки работоспособности. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
670 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
671 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
672 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
673 В ответе могут быть протестированы следующие объекты: |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
674 <list type="tag"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
675 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
676 <tag-name><literal>status 200;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
677 <tag-desc>код ответа равен 200</tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
678 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
679 <tag-name><literal>status ! 500;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
680 <tag-desc>код ответа не равен 500</tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
681 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
682 <tag-name><literal>status 200 204;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
683 <tag-desc>код ответа равен 200 или 204</tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
684 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
685 <tag-name><literal>status ! 301 302;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
686 <tag-desc>код ответа не равен ни 301, ни 302</tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
687 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
688 <tag-name><literal>status 200-399;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
689 <tag-desc>код ответа находится в диапазоне от 200 до 399</tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
690 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
691 <tag-name><literal>status ! 400-599;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
692 <tag-desc>код ответа находится вне диапазона от 400 до 599</tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
693 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
694 <tag-name><literal>status 301-303 307;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
695 <tag-desc>код ответа равен 301, 302, 303 или 307</tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
696 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
697 </list> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
698 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
699 <list type="tag"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
700 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
701 <tag-name><literal>header Content-Type = text/html;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
702 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
703 заголовок содержит <header>Content-Type</header> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
704 со значением <literal>text/html</literal> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
705 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
706 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
707 <tag-name><literal>header Content-Type != text/html;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
708 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
709 заголовок содержит <header>Content-Type</header> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
710 со значением, отличным от <literal>text/html</literal> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
711 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
712 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
713 <tag-name><literal>header Connection ~ close;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
714 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
715 заголовок содержит <header>Connection</header> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
716 со значением, совпадающим с регулярным выражением <literal>close</literal> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
717 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
718 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
719 <tag-name><literal>header Connection !~ close;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
720 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
721 заголовок содержит <header>Connection</header> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
722 со значением, не совпадающим с регулярным выражением <literal>close</literal> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
723 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
724 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
725 <tag-name><literal>header Host;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
726 <tag-desc>заголовок содержит <header>Host</header></tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
727 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
728 <tag-name><literal>header ! X-Accel-Redirect;</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
729 <tag-desc>заголовок не содержит <header>X-Accel-Redirect</header></tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
730 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
731 </list> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
732 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
733 <list type="tag"> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
734 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
735 <tag-name><literal>body ~ "Welcome to nginx!";</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
736 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
737 тело ответа совпадает с регулярным выражением |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
738 “<literal>Welcome to nginx!</literal>” |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
739 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
740 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
741 <tag-name><literal>body !~ "Welcome to nginx!";</literal></tag-name> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
742 <tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
743 тело ответа не совпадает с регулярным выражением |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
744 “<literal>Welcome to nginx!</literal>” |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
745 </tag-desc> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
746 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
747 </list> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
748 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
749 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
750 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
751 Если задано несколько тестов, |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
752 то ответ должен удовлетворять всем тестам. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
753 <note> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
754 Проверяются только первые 256 Кбайт тела ответа. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
755 </note> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
756 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
757 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
758 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
759 Примеры: |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
760 <example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
761 # код ответа 200, тип содержимого "text/html" |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
762 # и тело ответа содержит "Welcome to nginx!" |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
763 match welcome { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
764 status 200; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
765 header Content-Type = text/html; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
766 body ~ "Welcome to nginx!"; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
767 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
768 </example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
769 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
770 <example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
771 # код ответа не равен 301, 302, 303 и 307 и заголовок не содержит "Refresh:" |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
772 match not_redirect { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
773 status ! 301-303 307; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
774 header ! Refresh; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
775 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
776 </example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
777 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
778 <example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
779 # код ответа успешный и сервер не в сервисном режиме |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
780 match server_ok { |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
781 status 200-399; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
782 body !~ "maintenance mode"; |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
783 } |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
784 </example> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
785 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
786 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
787 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
788 <para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
789 <note> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
790 Эта директива доступна как часть |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
791 <commercial_version>коммерческой подписки</commercial_version>. |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
792 </note> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
793 </para> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
794 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
795 </directive> |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
796 |
935fe5eb82c4
Upstream: translated the "health_check" and "match" directives.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1241
diff
changeset
|
797 |
1122
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
798 <directive name="queue"> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
799 <syntax> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
800 <value>число</value> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
801 [<literal>timeout</literal>=<value>время</value>]</syntax> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
802 <default/> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
803 <context>upstream</context> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
804 <appeared-in>1.5.12</appeared-in> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
805 |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
806 <para> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
807 Если при обработке запроса невозможно сразу выбрать сервер группы |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
808 и в группе есть серверы, у которых число соединений достигло |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
809 ограничения <link id="max_conns"/>, |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
810 запрос будет помещён в очередь. |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
811 Директива задаёт максимальное число запросов, которые могут одновременно |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
812 находиться в очереди. |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
813 Если очередь переполнена |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
814 или за время, задаваемое параметром <literal>timeout</literal>, |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
815 так и не удастся выбрать сервер для передачи ему запроса, |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
816 клиенту будет возвращена ошибка. |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
817 </para> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
818 |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
819 <para> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
820 По умолчанию параметр <literal>timeout</literal> равен 60 секундам. |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
821 </para> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
822 |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
823 <para> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
824 <note> |
1128
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
825 Эта директива доступна как часть |
1594ed379f1f
De-i18n'ed <commercial_version/>.
Ruslan Ermilov <ru@nginx.com>
parents:
1127
diff
changeset
|
826 <commercial_version>коммерческой подписки</commercial_version>. |
1122
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
827 </note> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
828 </para> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
829 |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
830 </directive> |
594093ef96b1
Upstream: documented the "queue" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1121
diff
changeset
|
831 |
1234
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
832 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
833 <directive name="sticky"> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
834 <syntax><literal>cookie</literal> <value>имя</value> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
835 [<literal>expires=</literal><value>время</value>] |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
836 [<literal>domain=</literal><value>домен</value>] |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
837 [<literal>path=</literal><value>путь</value>]</syntax> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
838 <syntax><literal>route</literal> <value>переменная</value> ...</syntax> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
839 <default/> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
840 <context>upstream</context> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
841 <appeared-in>1.5.7</appeared-in> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
842 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
843 <para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
844 Включает режим привязки сеансов, в котором запросы клиента |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
845 будут передаваться на один и тот же сервер группы. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
846 Доступны два метода: |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
847 <literal>cookie</literal> и <literal>route</literal>. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
848 </para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
849 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
850 <para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
851 При использовании метода <literal>cookie</literal> информация о |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
852 назначенном сервере передаётся в HTTP-куке: |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
853 <example> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
854 upstream backend { |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
855 server backend1.example.com; |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
856 server backend2.example.com; |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
857 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
858 sticky cookie srv_id expires=1h domain=.example.com path=/; |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
859 } |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
860 </example> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
861 </para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
862 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
863 <para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
864 Запрос от клиента, ещё не привязанного к определённому серверу, |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
865 передаётся на сервер, выбранный согласно настроенному методу балансировки. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
866 Дальнейшие запросы от этого клиента передаются на тот же сервер. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
867 Если назначенный сервер не может обработать запрос, выбирается новый |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
868 сервер как если бы клиент не имел привязки к серверу. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
869 </para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
870 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
871 <para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
872 Первый параметр задаёт имя куки, которую необходимо установить или проверить. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
873 Дополнительные параметры могут быть следующими: |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
874 <list type="tag"> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
875 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
876 <tag-name><literal>expires</literal></tag-name> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
877 <tag-desc> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
878 Задаёт время, в течение которого браузеру необходимо хранить куку. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
879 Специальное значение <literal>max</literal> устанавливает срок хранения куки до |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
880 31 декабря 2037 года 23:55:55 GMT. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
881 Если параметр не указан, то время действия куки ограничивается сессией браузера. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
882 </tag-desc> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
883 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
884 <tag-name><literal>domain</literal></tag-name> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
885 <tag-desc> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
886 Задаёт домен, для которого устанавливается кука. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
887 </tag-desc> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
888 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
889 <tag-name><literal>path</literal></tag-name> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
890 <tag-desc> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
891 Задаёт путь, для которого устанавливается кука. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
892 </tag-desc> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
893 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
894 </list> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
895 Если пропущен тот или иной параметр, то соответствующего поля в куке не будет. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
896 </para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
897 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
898 <para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
899 При использовании метода <literal>route</literal> проксируемый сервер назначает |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
900 клиенту маршрут по получении первого запроса. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
901 Все последующие запросы от этого клиента будут содержать информацию о |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
902 маршруте в куке или URI. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
903 Эта информация сравнивается с параметром “<literal>route</literal>” директивы |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
904 <link id="server"/> для идентификации сервера, на который |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
905 следует проксировать запрос. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
906 Если назначенный сервер не может обработать запрос, выбирается новый сервер |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
907 согласно настроенному методу балансировки как если бы в запросе не было |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
908 информации о маршруте. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
909 </para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
910 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
911 <para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
912 Параметры метода <literal>route</literal> задают переменные, которые |
1238
763db729e6a4
Upstream: corrected translation in sticky route.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1237
diff
changeset
|
913 могут содержать информацию о маршруте. |
1234
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
914 Первая непустая переменная используется для поиска соответствующего сервера. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
915 </para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
916 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
917 <para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
918 Пример: |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
919 <example> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
920 map $cookie_jsessionid $route_cookie { |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
921 ~.+\.(?P<route>\w+)$ $route; |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
922 } |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
923 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
924 map $request_uri $route_uri { |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
925 ~jsessionid=.+\.(?P<route>\w+)$ $route; |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
926 } |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
927 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
928 upstream backend { |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
929 server backend1.example.com route=a; |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
930 server backend2.example.com route=b; |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
931 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
932 sticky route $route_cookie $route_uri; |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
933 } |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
934 </example> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
935 В этом примере маршрут берётся из куки “<literal>JSESSIONID</literal>”, |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
936 если она присутствует в запросе. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
937 В противном случае используется маршрут из URI. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
938 </para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
939 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
940 <para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
941 <note> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
942 Эта директива доступна как часть |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
943 <commercial_version>коммерческой подписки</commercial_version>. |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
944 </note> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
945 </para> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
946 |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
947 </directive> |
314801ed88e7
Upstream: translated the "sticky" directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1230
diff
changeset
|
948 |
1237
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
949 |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
950 <directive name="sticky_cookie_insert"> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
951 <syntax><value>имя</value> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
952 [<literal>expires=</literal><value>время</value>] |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
953 [<literal>domain=</literal><value>домен</value>] |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
954 [<literal>path=</literal><value>путь</value>]</syntax> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
955 <default/> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
956 <context>upstream</context> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
957 |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
958 <para> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
959 Эта директива устарела начиная с версии 1.5.7. |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
960 Вместо неё следует использовать аналогичную директиву |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
961 <link id="sticky"/> с изменённым синтаксисом: |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
962 <note> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
963 <literal>sticky cookie</literal> <value>имя</value> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
964 [<literal>expires=</literal><value>время</value>] |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
965 [<literal>domain=</literal><value>домен</value>] |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
966 [<literal>path=</literal><value>путь</value>]; |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
967 </note> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
968 </para> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
969 |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
970 </directive> |
e0a1a929a458
Upstream: translated the sticky_cookie_insert directive.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1234
diff
changeset
|
971 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
972 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
973 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
974 |
292 | 975 <section id="variables" name="Встроенные переменные"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
976 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
977 <para> |
292 | 978 Модуль <literal>ngx_http_upstream_module</literal> |
979 поддерживает следующие встроенные переменные: | |
980 <list type="tag"> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
981 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
982 <tag-name id="var_upstream_addr"><var>$upstream_addr</var></tag-name> |
292 | 983 <tag-desc> |
984 хранит IP-адрес и порт сервера или путь к UNIX-сокету. | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
985 Если при обработке запроса были сделаны обращения к нескольким серверам, |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
986 то их адреса разделяются запятой, например, |
292 | 987 “<literal>192.168.1.1:80, 192.168.1.2:80, unix:/tmp/sock</literal>”. |
256
c78b2d6fe261
Use another term for "redirect".
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
988 Если произошло внутреннее перенаправление от одной группы серверов на другую |
c78b2d6fe261
Use another term for "redirect".
Ruslan Ermilov <ru@nginx.com>
parents:
222
diff
changeset
|
989 с помощью |
292 | 990 <header>X-Accel-Redirect</header> или |
991 <link doc="ngx_http_core_module.xml" id="error_page"/>, | |
966 | 992 то адреса, соответствующие разным группам серверов, разделяются двоеточием, |
993 например, | |
292 | 994 “<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>”. |
995 </tag-desc> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
996 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
997 <tag-name id="var_upstream_cache_status"><var>$upstream_cache_status</var> |
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
998 </tag-name> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
999 <tag-desc> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1000 хранит статус доступа к кэшу ответов (0.8.3). |
1075
6c021feec587
Removed unjustified non-breakable spaces.
Ruslan Ermilov <ru@nginx.com>
parents:
1016
diff
changeset
|
1001 Статус может быть одним из “<literal>MISS</literal>”, |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1002 “<literal>BYPASS</literal>”, “<literal>EXPIRED</literal>”, |
1016
2d8269d8fea8
Translated documentation on cache revalidation into russian.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
1003 “<literal>STALE</literal>”, “<literal>UPDATING</literal>”, |
2d8269d8fea8
Translated documentation on cache revalidation into russian.
Vladimir Homutov <vl@nginx.com>
parents:
966
diff
changeset
|
1004 “<literal>REVALIDATED</literal>” или “<literal>HIT</literal>”. |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1005 </tag-desc> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1006 |
1186
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1007 <tag-name id="var_upstream_cookie_"><var>$upstream_cookie_</var><value>имя</value></tag-name> |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1008 <tag-desc> |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1009 кука с указанным <value>именем</value>, переданная сервером группы |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1010 в поле <header>Set-Cookie</header> заголовка ответа (1.7.1). |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1011 Необходимо иметь в виду, что запоминаются поля заголовка только из ответа |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1012 последнего сервера. |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1013 </tag-desc> |
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1014 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1015 <tag-name id="var_upstream_response_length"><var>$upstream_response_length</var> |
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1016 </tag-name> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1017 <tag-desc> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1018 хранит длины ответов, полученных от серверов группы (0.7.27); |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1019 длины хранятся в байтах. |
966 | 1020 Длины нескольких ответов разделяются запятыми и двоеточиями |
1021 подобно адресам в переменной <var>$upstream_addr</var>. | |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1022 </tag-desc> |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1023 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1024 <tag-name id="var_upstream_response_time"><var>$upstream_response_time</var> |
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1025 </tag-name> |
292 | 1026 <tag-desc> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1027 хранит времена ответов, полученных от серверов группы; |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1028 времена хранятся в секундах с точностью до миллисекунд. |
966 | 1029 Времена нескольких ответов разделяются запятыми и двоеточиями |
1030 подобно адресам в переменной <var>$upstream_addr</var>. | |
292 | 1031 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1032 |
1155
07402a11fd8d
Assigned IDs to tags describing variables.
Vladimir Homutov <vl@nginx.com>
parents:
1128
diff
changeset
|
1033 <tag-name id="var_upstream_status"><var>$upstream_status</var></tag-name> |
292 | 1034 <tag-desc> |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1035 хранит коды ответов, полученных от серверов группы. |
966 | 1036 Коды нескольких ответов разделяются запятыми и двоеточиями |
1037 подобно адресам в переменной <var>$upstream_addr</var>. | |
292 | 1038 </tag-desc> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1039 |
1186
8125bec5c7a1
Upstream: documented the $upstream_cookie_* variables.
Ruslan Ermilov <ru@nginx.com>
parents:
1181
diff
changeset
|
1040 <tag-name id="var_upstream_http_"><var>$upstream_http_</var><value>имя</value></tag-name> |
292 | 1041 <tag-desc> |
1042 хранят поля заголовка ответа сервера. | |
1043 Например, поле заголовка ответа <header>Server</header> | |
1044 доступно в переменной <var>$upstream_http_server</var>. | |
731
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1045 Правила преобразования имён полей заголовка ответа в имена переменных |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1046 такие же, как для переменных с префиксом |
f62328124e5b
Documented $upstream_cache_status and $upstream_response_length variables.
Vladimir Homutov <vl@nginx.com>
parents:
654
diff
changeset
|
1047 “<link doc="ngx_http_core_module.xml" id="variables">$http_</link>”. |
966 | 1048 Необходимо иметь в виду, что запоминаются поля заголовка только из ответа |
292 | 1049 последнего сервера. |
1050 </tag-desc> | |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1051 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1052 </list> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1053 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1054 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1055 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1056 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1057 </module> |