Mercurial > hg > nginx-site
annotate xml/ru/docs/http/ngx_http_limit_conn_module.xml @ 2733:9cc5077645a0
Linux packages: removed Alpine 3.10 due to EOL.
author | Konstantin Pavlov <thresh@nginx.com> |
---|---|
date | Thu, 27 May 2021 12:48:06 +0300 |
parents | eeed494bba51 |
children | a85e4d126bc7 |
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> |
1566
0ca33afb461b
Added the http2 module.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1347
diff
changeset
|
79 В HTTP/2 и SPDY каждый параллельный запрос считается отдельным соединением. |
1347
7d028fc94593
Added a note about SPDY connections in limit_conn.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1320
diff
changeset
|
80 </note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
81 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
82 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
83 <para> |
1628
d846df055f03
Disambiguated a sentence about multiple limit_conn limits.
Ruslan Ermilov <ru@nginx.com>
parents:
1623
diff
changeset
|
84 Директив <literal>limit_conn</literal> может быть несколько. |
207
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
85 Например, следующая конфигурация ограничивает число соединений с сервером |
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
86 с одного клиентского IP-адреса и в то же время ограничивает общее число |
1623
a3509ca11ab4
The term "virtual server" is more common in nginx.
Ruslan Ermilov <ru@nginx.com>
parents:
1566
diff
changeset
|
87 соединений с виртуальным сервером: |
207
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
88 <example> |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
89 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
|
90 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
|
91 |
351
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
92 server { |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
93 ... |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
94 limit_conn perip 10; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
95 limit_conn perserver 100; |
a4fa80755eab
Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents:
271
diff
changeset
|
96 } |
207
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
97 </example> |
2df68271c898
Provided an example of using several "limit_conn" directives.
Ruslan Ermilov <ru@nginx.com>
parents:
180
diff
changeset
|
98 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
99 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
100 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
101 <para> |
2593
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2495
diff
changeset
|
102 Директивы наследуются с предыдущего уровня конфигурации при условии, что |
eeed494bba51
Unified phrases about configuration levels and inheritance.
Ruslan Ermilov <ru@nginx.com>
parents:
2495
diff
changeset
|
103 на данном уровне не описаны свои директивы <literal>limit_conn</literal>. |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
104 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
105 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
106 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
107 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
108 |
2464
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
109 <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
|
110 <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
|
111 <default>off</default> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
112 <context>http</context> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
113 <context>server</context> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
114 <context>location</context> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
115 <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
|
116 |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
117 <para> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
118 Включает режим пробного запуска. |
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 </para> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
123 |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
124 </directive> |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
125 |
5d7fd7d9a2b6
Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2013
diff
changeset
|
126 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
127 <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
|
128 <syntax> |
271 | 129 <literal>info</literal> | |
130 <literal>notice</literal> | | |
131 <literal>warn</literal> | | |
132 <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
|
133 <default>error</default> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
134 <context>http</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
135 <context>server</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
136 <context>location</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
137 <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
|
138 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
139 <para> |
380 | 140 Задаёт желаемый уровень записи в лог случаев ограничения |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
141 числа соединений. |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
142 </para> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
143 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
144 </directive> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
145 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
146 |
870
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
147 <directive name="limit_conn_status"> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
148 <syntax><value>код</value></syntax> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
149 <default>503</default> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
150 <context>http</context> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
151 <context>server</context> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
152 <context>location</context> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
153 <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
|
154 |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
155 <para> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
156 Позволяет переопределить код ответа, используемый при отклонении запросов. |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
157 </para> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
158 |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
159 </directive> |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
160 |
6087d3fa6919
The limit_req_status and limit_conn_status directives.
Maxim Dounin <mdounin@mdounin.ru>
parents:
589
diff
changeset
|
161 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
162 <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
|
163 <syntax> |
1320
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
164 <value>ключ</value> |
271 | 165 <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
|
166 <default/> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
167 <context>http</context> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
168 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
169 <para> |
575
ebcb351d9eb3
Consistently using the term "shared memory zone".
Ruslan Ermilov <ru@nginx.com>
parents:
390
diff
changeset
|
170 Задаёт параметры зоны разделяемой памяти, которая хранит состояние |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
171 для разных значений ключа. |
966 | 172 Состояние в частности содержит текущее число соединений. |
1320
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
173 В качестве ключа можно использовать текст, переменные и их комбинации. |
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 <note> |
f15a983cac66
Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents:
1312
diff
changeset
|
176 До версии 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
|
177 </note> |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
178 Пример использования: |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
179 <example> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
180 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
|
181 </example> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
182 Здесь в качестве ключа используется IP-адрес клиента. |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
183 Обратите внимание, что вместо переменной <var>$remote_addr</var> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
184 использована переменная <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
|
185 Длина значения переменной <var>$remote_addr</var> может колебаться |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
186 от 7 до 15 байт, при этом размер хранимого состояния составляет |
966 | 187 либо 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
|
188 байта на 64-битных. |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
189 Длина значения переменной <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
|
190 равна 4 байтам для IPv4-адресов или 16 байтам для IPv6-адресов. |
6c96a644b0b3
Corrected description of $binary_remote_addr and saved state.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
1628
diff
changeset
|
191 При этом размер состояния всегда равен 32 или 64 байтам |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
192 на 32-битных платформах и 64 байтам на 64-битных. |
367
f4033b9bc4ec
- Removed unnecessary instances of unbreakable space.
Ruslan Ermilov <ru@nginx.com>
parents:
365
diff
changeset
|
193 В зоне размером 1 мегабайт может разместиться около 32 тысяч состояний |
966 | 194 размером 32 байта или 16 тысяч состояний размером 64 байта. |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
195 При переполнении зоны в ответ на последующие запросы сервер будет |
2013
469aebbd94d0
Limit_req/limit_conn may return not only 503 on failure.
Ruslan Ermilov <ru@nginx.com>
parents:
1699
diff
changeset
|
196 возвращать |
469aebbd94d0
Limit_req/limit_conn may return not only 503 on failure.
Ruslan Ermilov <ru@nginx.com>
parents:
1699
diff
changeset
|
197 <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
|
198 </para> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
199 |
2495
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
200 <para> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
201 <note> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
202 Дополнительно, как часть |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
203 <commercial_version>коммерческой подписки</commercial_version>, |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
204 <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
|
205 каждой такой зоны разделяемой памяти можно |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
206 <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
|
207 <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
|
208 при помощи <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
|
209 начиная с версии 1.17.7. |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
210 </note> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
211 </para> |
e4332b7580bb
Mentioned API in limit_conn_zone and limit_req_zone.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2465
diff
changeset
|
212 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
213 </directive> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
214 |
365 | 215 |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
216 <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
|
217 <syntax> |
271 | 218 <value>название</value> |
219 <value>$переменная</value> | |
220 <value>размер</value></syntax> | |
179
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
221 <default/> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
222 <context>http</context> |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
223 |
8cc01e2179a9
- Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
110
diff
changeset
|
224 <para> |
1312
91a4eee45eb7
Limit_conn: the limit_zone directive removed from the code.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
225 Эта директива устарела в версии 1.1.8 |
91a4eee45eb7
Limit_conn: the limit_zone directive removed from the code.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
226 и была удалена в версии 1.7.6. |
91a4eee45eb7
Limit_conn: the limit_zone directive removed from the code.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
966
diff
changeset
|
227 Вместо неё следует |
180
9e7d0c9c7eaa
Mentioned the compatible "limit_conn_zone" directive syntax for the
Ruslan Ermilov <ru@nginx.com>
parents:
179
diff
changeset
|
228 использовать аналогичную директиву <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
|
229 с изменённым синтаксисом: |
9e7d0c9c7eaa
Mentioned the compatible "limit_conn_zone" directive syntax for the
Ruslan Ermilov <ru@nginx.com>
parents:
179
diff
changeset
|
230 <note> |
271 | 231 <literal>limit_conn_zone</literal> |
232 <value>$переменная</value> | |
233 <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
|
234 </note> |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
235 </para> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
236 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
237 </directive> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
238 |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
239 </section> |
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
240 |
2465
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
241 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
242 <section id="variables" name="Встроенные переменные"> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
243 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
244 <para> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
245 <list type="tag"> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
246 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
247 <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
|
248 <tag-desc> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
249 хранит результат ограничения числа соединений (1.17.6): |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
250 <literal>PASSED</literal>, |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
251 <literal>REJECTED</literal> или |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
252 <literal>REJECTED_DRY_RUN</literal> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
253 </tag-desc> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
254 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
255 </list> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
256 </para> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
257 |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
258 </section> |
07c4f2c66c97
Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents:
2464
diff
changeset
|
259 |
76
4a4caa566120
Russian documentation import.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
260 </module> |