annotate xml/en/docs/stream/ngx_stream_limit_conn_module.xml @ 2465:07c4f2c66c97

Documented $limit_conn_status for http and stream.
author Yaroslav Zhuravlev <yar@nginx.com>
date Tue, 19 Nov 2019 17:55:03 +0300
parents 5d7fd7d9a2b6
children e4332b7580bb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
222
bfe3eff81d04 Removed redundant encoding specification.
Ruslan Ermilov <ru@nginx.com>
parents: 207
diff changeset
1 <?xml version="1.0"?>
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
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
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
8 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd">
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
9
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
10 <module name="Module ngx_stream_limit_conn_module"
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
11 link="/en/docs/stream/ngx_stream_limit_conn_module.html"
589
764fbac1b8b4 Added document revision.
Ruslan Ermilov <ru@nginx.com>
parents: 580
diff changeset
12 lang="en"
2465
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
13 rev="5">
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
14
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
15 <section id="summary">
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
16
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
17 <para>
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
18 The <literal>ngx_stream_limit_conn_module</literal> module (1.9.3) is used to
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
19 limit the number of connections per the defined key, in
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
20 particular, the number of connections from a single IP address.
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
21 </para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
22
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
23 </section>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
24
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
25
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
26 <section id="example" name="Example Configuration">
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
27
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
28 <para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
29 <example>
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
30 stream {
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
31 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:
diff changeset
32
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
33 ...
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
34
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
35 server {
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
36
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
37 ...
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
38
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
39 limit_conn addr 1;
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
40 limit_conn_log_level error;
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
41 }
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
42 }
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
43 </example>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
44 </para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
45
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
46 </section>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
47
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
48
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
49 <section id="directives" name="Directives">
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
50
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
51 <directive name="limit_conn">
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
52 <syntax><value>zone</value> <value>number</value></syntax>
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
53 <default/>
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
54 <context>stream</context>
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
55 <context>server</context>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
56
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
57 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
58 Sets the shared memory zone
575
ebcb351d9eb3 Consistently using the term "shared memory zone".
Ruslan Ermilov <ru@nginx.com>
parents: 390
diff changeset
59 and the maximum allowed number of connections for a given key value.
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
60 When this limit is exceeded, the server will close the connection.
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
61 For example, the directives
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
62 <example>
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 271
diff changeset
63 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:
diff changeset
64
351
a4fa80755eab Consistently strip initial offset in examples.
Ruslan Ermilov <ru@nginx.com>
parents: 271
diff changeset
65 server {
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
66 ...
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
67 limit_conn addr 1;
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
68 }
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
69 </example>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
70 allow only one connection per an IP address at a time.
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
71 </para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
72
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
73 <para>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
74 When several <literal>limit_conn</literal> directives are specified,
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
75 any configured limit will apply.
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
76 </para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
77
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
78 <para>
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
79 The directives are inherited from the previous level if and
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
80 only if there are no
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
81 <literal>limit_conn</literal>
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
82 directives on the current level.
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
83 </para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
84
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
85 </directive>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
86
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
87
2464
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
88 <directive name="limit_conn_dry_run">
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
89 <syntax><literal>on</literal> | <literal>off</literal></syntax>
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
90 <default>off</default>
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
91 <context>stream</context>
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
92 <context>server</context>
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
93 <appeared-in>1.17.6</appeared-in>
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
94
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
95 <para>
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
96 Enables the dry run mode.
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
97 In this mode, the number of connections is not limited, however,
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
98 in the shared memory zone, the number of excessive connections is accounted
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
99 as usual.
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
100 </para>
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
101
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
102 </directive>
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
103
5d7fd7d9a2b6 Documented limit_conn_dry_run for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1744
diff changeset
104
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
105 <directive name="limit_conn_log_level">
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
106 <syntax>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
107 <literal>info</literal> |
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
108 <literal>notice</literal> |
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
109 <literal>warn</literal> |
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
110 <literal>error</literal></syntax>
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
111 <default>error</default>
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
112 <context>stream</context>
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
113 <context>server</context>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
114
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
115 <para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
116 Sets the desired logging level for cases when the server
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
117 limits the number of connections.
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
118 </para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
119
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
120 </directive>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
121
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
122
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
123 <directive name="limit_conn_zone">
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
124 <syntax>
1320
f15a983cac66 Limit conn/req: key is no longer limited to only one variable.
Ruslan Ermilov <ru@nginx.com>
parents: 1312
diff changeset
125 <value>key</value>
271
4c6d2c614d2c Cleaned up XML tag mess:
Ruslan Ermilov <ru@nginx.com>
parents: 270
diff changeset
126 <literal>zone</literal>=<value>name</value>:<value>size</value></syntax>
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
127 <default/>
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
128 <context>stream</context>
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
129
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
130 <para>
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
131 Sets parameters for a shared memory zone
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
132 that will keep states for various keys.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
133 In particular, the state includes the current number of connections.
1744
ab56dcd73af2 Added variables to stream hash, limit_conn_zone, proxy_bind.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1699
diff changeset
134 The <value>key</value> can contain text, variables,
ab56dcd73af2 Added variables to stream hash, limit_conn_zone, proxy_bind.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1699
diff changeset
135 and their combinations (1.11.2).
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
136 Connections with an empty key value are not accounted.
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
137 Usage example:
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
138 <example>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
139 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:
diff changeset
140 </example>
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
141 Here, the key is a client IP address set by the
1744
ab56dcd73af2 Added variables to stream hash, limit_conn_zone, proxy_bind.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1699
diff changeset
142 <literal>$binary_remote_addr</literal> variable.
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
143 The size of <literal>$binary_remote_addr</literal>
1699
6c96a644b0b3 Corrected description of $binary_remote_addr and saved state.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1517
diff changeset
144 is 4 bytes for IPv4 addresses or 16 bytes for IPv6 addresses.
6c96a644b0b3 Corrected description of $binary_remote_addr and saved state.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1517
diff changeset
145 The stored state always occupies 32 or 64 bytes
966
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
146 on 32-bit platforms and 64 bytes on 64-bit platforms.
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
147 One megabyte zone can keep about 32 thousand 32-byte states
95c3c3bbf1ce Text review.
Egor Nikitin <yegor.nikitin@gmail.com>
parents: 870
diff changeset
148 or about 16 thousand 64-byte states.
1517
53ae63cb4cfa Added the limit_conn module for stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 1347
diff changeset
149 If the zone storage is exhausted, the server will close the connection.
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
150 </para>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
151
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
152 </directive>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
153
2465
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
154 </section>
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
155
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
156
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
157 <section id="variables" name="Embedded Variables">
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
158
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
159 <para>
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
160 <list type="tag">
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
161
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
162 <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
163 <tag-desc>
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
164 keeps the result of limiting the number of connections (1.17.6):
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
165 <literal>PASSED</literal>,
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
166 <literal>REJECTED</literal>, or
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
167 <literal>REJECTED_DRY_RUN</literal>
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
168 </tag-desc>
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
169
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
170 </list>
07c4f2c66c97 Documented $limit_conn_status for http and stream.
Yaroslav Zhuravlev <yar@nginx.com>
parents: 2464
diff changeset
171 </para>
364
bb51d3e17dd0 Style fixed.
Ruslan Ermilov <ru@nginx.com>
parents: 351
diff changeset
172
179
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
173 </section>
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
174
8cc01e2179a9 - Reflected recent changes made to ngx_http_limit_conn_module.
Ruslan Ermilov <ru@nginx.com>
parents:
diff changeset
175 </module>