Mercurial > hg > nginx-site
annotate xml/ru/docs/http/ngx_http_limit_conn_module.xml @ 2976:cbd963190c15
Documented the http2 directive.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Tue, 13 Jun 2023 16:04:45 +0100 |
parents | a85e4d126bc7 |
children | 9eadb98ec770 |
rev | line source |
---|---|
222
bfe3eff81d04
Removed redundant encoding specification.
Ruslan Ermilov <ru@nginx.com>
parents:
207
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:
575
diff
changeset
|
3 <!-- |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
diff
changeset
|
4 Copyright (C) Igor Sysoev |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
diff
changeset
|
5 Copyright (C) Nginx, Inc. |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
diff
changeset
|
6 --> |
be54c443235a
Added copyright markers to documentation sources.
Ruslan Ermilov <ru@nginx.com>
parents:
575
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 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
10 <module name="Модуль ngx_http_limit_conn_module" |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
11 link="/ru/docs/http/ngx_http_limit_conn_module.html" |
589 | 12 lang="ru" |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2495
diff
changeset
|
13 rev="14"> |
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:
102
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> |
271 | 18 Модуль <literal>ngx_http_limit_conn_module</literal> позволяет ограничить |
966 | 19 число соединений по заданному ключу, в частности, число соединений с одного |
20 IP-адреса. | |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
21 </para> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
22 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
23 <para> |
966 | 24 Учитываются не все соединения, а лишь те, в которых имеются |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
25 запросы, обрабатываемые сервером, и заголовок запроса уже прочитан. |
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 |
365 | 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> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 http { |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
36 limit_conn_zone $binary_remote_addr zone=addr:10m; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 ... |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 server { |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 |
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 location /download/ { |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
45 limit_conn addr 1; |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
46 } |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
47 </example> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
48 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
49 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
50 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
51 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
52 |
365 | 53 <section id="directives" name="Директивы"> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
54 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
55 <directive name="limit_conn"> |
271 | 56 <syntax><value>зона</value> <value>число</value></syntax> |
99
1d315ef37215
The case <default/> is now language-agnostic.
Ruslan Ermilov <ru@nginx.com>
parents:
76
diff
changeset
|
57 <default/> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
58 <context>http</context> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
59 <context>server</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
60 <context>location</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
61 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
62 <para> |
575
ebcb351d9eb3
Consistently using the term "shared memory zone".
Ruslan Ermilov <ru@nginx.com>
parents:
390
diff
changeset
|
63 Задаёт зону разделяемой памяти и максимально допустимое число соединений |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
64 для одного значения ключа. |
2013
469aebbd94d0
Limit_req/limit_conn may return not only 503 on failure.
Ruslan Ermilov <ru@nginx.com>
parents:
1699
diff
changeset
|
65 При превышении этого числа в ответ на запрос сервер вернёт |
469aebbd94d0
Limit_req/limit_conn may return not only 503 on failure.
Ruslan Ermilov <ru@nginx.com>
parents:
1699
diff
changeset
|
66 <link id="limit_conn_status">ошибку</link>. |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
67 Например, директивы |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
68 <example> |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
69 limit_conn_zone $binary_remote_addr zone=addr:10m; |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
70 |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
71 server { |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
72 location /download/ { |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
73 limit_conn addr 1; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
74 } |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
75 </example> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
76 разрешают одновременно обрабатывать не более одного соединения с одного |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
77 IP-адреса. |
1347
7d028fc94593
Added a note about SPDY connections in limit_conn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1320
diff
changeset
|
78 <note> |
2956
a85e4d126bc7
Updated docs for the upcoming NGINX Plus release.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2593
diff
changeset
|
79 В HTTP/2 и HTTP/3 |
a85e4d126bc7
Updated docs for the upcoming NGINX Plus release.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2593
diff
changeset
|
80 каждый параллельный запрос считается отдельным соединением. |
1347
7d028fc94593
Added a note about SPDY connections in limit_conn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1320
diff
changeset
|
81 </note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
82 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
84 <para> |
1628
d846df055f03
Disambiguated a sentence about multiple limit_conn limits.
Ruslan Ermilov <ru@nginx.com>
parents:
1623
diff
changeset
|
85 Директив <literal>limit_conn</literal> может быть несколько. |
207
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
86 Например, следующая конфигурация ограничивает число соединений с сервером |
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
87 с одного клиентского IP-адреса и в то же время ограничивает общее число |
1623
a3509ca11ab4
The term "virtual server" is more common in nginx.
Ruslan Ermilov <ru@nginx.com>
parents:
1566
diff
changeset
|
88 соединений с виртуальным сервером: |
207
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
89 <example> |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
90 limit_conn_zone $binary_remote_addr zone=perip:10m; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
91 limit_conn_zone $server_name zone=perserver:10m; |
207
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
92 |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
93 server { |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
94 ... |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
95 limit_conn perip 10; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
96 limit_conn perserver 100; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
97 } |
207
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
98 </example> |
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
99 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
100 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
102 <para> |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2495
diff
changeset
|
103 Директивы наследуются с предыдущего уровня конфигурации при условии, что |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2495
diff
changeset
|
104 на данном уровне не описаны свои директивы <literal>limit_conn</literal>. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
105 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
106 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
107 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
109 |
2464
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
110 <directive name="limit_conn_dry_run"> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
111 <syntax><literal>on</literal> | <literal>off</literal></syntax> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
112 <default>off</default> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
113 <context>http</context> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
114 <context>server</context> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
115 <context>location</context> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
116 <appeared-in>1.17.6</appeared-in> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
117 |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
118 <para> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
119 Включает режим пробного запуска. |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
120 В данном режиме число соединений не ограничивается, однако |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
121 в зоне разделяемой памяти текущее число избыточных соединений учитывается |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
122 как обычно. |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
123 </para> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
124 |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
125 </directive> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
126 |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
127 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
128 <directive name="limit_conn_log_level"> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
129 <syntax> |
271 | 130 <literal>info</literal> | |
131 <literal>notice</literal> | | |
132 <literal>warn</literal> | | |
133 <literal>error</literal></syntax> | |
102
c76a257f3fd4
The directive name is now automatically printed in <default> and <syntax>.
Ruslan Ermilov <ru@nginx.com>
parents:
99
diff
changeset
|
134 <default>error</default> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
135 <context>http</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
136 <context>server</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
137 <context>location</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
138 <appeared-in>0.8.18</appeared-in> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
139 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
140 <para> |
380 | 141 Задаёт желаемый уровень записи в лог случаев ограничения |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
142 числа соединений. |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
143 </para> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
144 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
145 </directive> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
146 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
147 |
870
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
148 <directive name="limit_conn_status"> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
149 <syntax><value>код</value></syntax> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
150 <default>503</default> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
151 <context>http</context> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
152 <context>server</context> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
153 <context>location</context> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
154 <appeared-in>1.3.15</appeared-in> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
155 |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
156 <para> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
157 Позволяет переопределить код ответа, используемый при отклонении запросов. |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
158 </para> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
159 |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
160 </directive> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
161 |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
162 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
163 <directive name="limit_conn_zone"> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
164 <syntax> |
1320
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
165 <value>ключ</value> |
271 | 166 <literal>zone</literal>=<value>название</value>:<value>размер</value></syntax> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
167 <default/> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
168 <context>http</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
169 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
170 <para> |
575
ebcb351d9eb3
Consistently using the term "shared memory zone".
Ruslan Ermilov <ru@nginx.com>
parents:
390
diff
changeset
|
171 Задаёт параметры зоны разделяемой памяти, которая хранит состояние |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
172 для разных значений ключа. |
966 | 173 Состояние в частности содержит текущее число соединений. |
1320
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
174 В качестве ключа можно использовать текст, переменные и их комбинации. |
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
175 Запросы с пустым значением ключа не учитываются. |
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
176 <note> |
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
177 До версии 1.7.6 в качестве ключа можно было задать ровно одну переменную. |
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
178 </note> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
179 Пример использования: |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
180 <example> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
181 limit_conn_zone $binary_remote_addr zone=addr:10m; |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
182 </example> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
183 Здесь в качестве ключа используется IP-адрес клиента. |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
184 Обратите внимание, что вместо переменной <var>$remote_addr</var> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
185 использована переменная <var>$binary_remote_addr</var>. |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
186 Длина значения переменной <var>$remote_addr</var> может колебаться |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
187 от 7 до 15 байт, при этом размер хранимого состояния составляет |
966 | 188 либо 32, либо 64 байта на 32-битных платформах и всегда 64 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
189 байта на 64-битных. |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
190 Длина значения переменной <var>$binary_remote_addr</var> всегда |
1699
6c96a644b0b3
Corrected description of $binary_remote_addr and saved state.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1628
diff
changeset
|
191 равна 4 байтам для IPv4-адресов или 16 байтам для IPv6-адресов. |
6c96a644b0b3
Corrected description of $binary_remote_addr and saved state.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1628
diff
changeset
|
192 При этом размер состояния всегда равен 32 или 64 байтам |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
193 на 32-битных платформах и 64 байтам на 64-битных. |
367
f4033b9bc4ec
- Removed unnecessary instances of unbreakable space.
Ruslan Ermilov <ru@nginx.com>
parents:
365
diff
changeset
|
194 В зоне размером 1 мегабайт может разместиться около 32 тысяч состояний |
966 | 195 размером 32 байта или 16 тысяч состояний размером 64 байта. |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
196 При переполнении зоны в ответ на последующие запросы сервер будет |
2013
469aebbd94d0
Limit_req/limit_conn may return not only 503 on failure.
Ruslan Ermilov <ru@nginx.com>
parents:
1699
diff
changeset
|
197 возвращать |
469aebbd94d0
Limit_req/limit_conn may return not only 503 on failure.
Ruslan Ermilov <ru@nginx.com>
parents:
1699
diff
changeset
|
198 <link id="limit_conn_status">ошибку</link>. |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
199 </para> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
200 |
2495
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
201 <para> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
202 <note> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
203 Дополнительно, как часть |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
204 <commercial_version>коммерческой подписки</commercial_version>, |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
205 <link doc="ngx_http_api_module.xml" id="http_limit_conns_">информацию о состоянии</link> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
206 каждой такой зоны разделяемой памяти можно |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
207 <link doc="ngx_http_api_module.xml" id="getHttpLimitConnZone">получить</link> или |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
208 <link doc="ngx_http_api_module.xml" id="deleteHttpLimitConnZoneStat">сбросить</link> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
209 при помощи <link doc="ngx_http_api_module.xml">API</link> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
210 начиная с версии 1.17.7. |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
211 </note> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
212 </para> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
213 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
214 </directive> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
215 |
365 | 216 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
217 <directive name="limit_zone"> |
270
945d7299c26c
Spaces are now preserved here, so removed all the hacks.
Ruslan Ermilov <ru@nginx.com>
parents:
227
diff
changeset
|
218 <syntax> |
271 | 219 <value>название</value> |
220 <value>$переменная</value> | |
221 <value>размер</value></syntax> | |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
222 <default/> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
223 <context>http</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
224 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
225 <para> |
1312
91a4eee45eb7
Limit_conn: the limit_zone directive removed from the code.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
226 Эта директива устарела в версии 1.1.8 |
91a4eee45eb7
Limit_conn: the limit_zone directive removed from the code.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
227 и была удалена в версии 1.7.6. |
91a4eee45eb7
Limit_conn: the limit_zone directive removed from the code.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
228 Вместо неё следует |
180
9e7d0c9c7eaa
Mentioned the compatible "limit_conn_zone" directive syntax for the
Ruslan Ermilov <ru@nginx.com>
parents:
179
diff
changeset
|
229 использовать аналогичную директиву <link id="limit_conn_zone"/> |
9e7d0c9c7eaa
Mentioned the compatible "limit_conn_zone" directive syntax for the
Ruslan Ermilov <ru@nginx.com>
parents:
179
diff
changeset
|
230 с изменённым синтаксисом: |
9e7d0c9c7eaa
Mentioned the compatible "limit_conn_zone" directive syntax for the
Ruslan Ermilov <ru@nginx.com>
parents:
179
diff
changeset
|
231 <note> |
271 | 232 <literal>limit_conn_zone</literal> |
233 <value>$переменная</value> | |
234 <literal>zone</literal>=<value>название</value>:<value>размер</value>; | |
180
9e7d0c9c7eaa
Mentioned the compatible "limit_conn_zone" directive syntax for the
Ruslan Ermilov <ru@nginx.com>
parents:
179
diff
changeset
|
235 </note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
236 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
237 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
238 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
239 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
240 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
241 |
2465
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
242 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
243 <section id="variables" name="Встроенные переменные"> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
244 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
245 <para> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
246 <list type="tag"> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
247 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
248 <tag-name id="var_limit_conn_status"><var>$limit_conn_status</var></tag-name> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
249 <tag-desc> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
250 хранит результат ограничения числа соединений (1.17.6): |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
251 <literal>PASSED</literal>, |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
252 <literal>REJECTED</literal> или |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
253 <literal>REJECTED_DRY_RUN</literal> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
254 </tag-desc> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
255 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
256 </list> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
257 </para> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
258 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
259 </section> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
260 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
261 </module> |