comparison xml/en/docs/http/ngx_http_limit_conn_module.xml @ 207:2df68271c898

Provided an example of using several "limit_conn" directives.
author Ruslan Ermilov <ru@nginx.com>
date Mon, 28 Nov 2011 07:18:22 +0000
parents 9e7d0c9c7eaa
children bfe3eff81d04
comparison
equal deleted inserted replaced
206:b7323871813e 207:2df68271c898
59 When this limit is exceeded, the server will return error 59 When this limit is exceeded, the server will return error
60 <http-status code="503" text="Service Temporarily Unavailable"/> 60 <http-status code="503" text="Service Temporarily Unavailable"/>
61 in reply to a request. 61 in reply to a request.
62 For example, the directives 62 For example, the directives
63 <example> 63 <example>
64 limit_conn_zone $binary_remote_addr zone=addr:10m; 64 limit_conn_zone $binary_remote_addr zone=addr:10m;
65 65
66 server { 66 server {
67 location /download/ { 67 location /download/ {
68 limit_conn addr 1; 68 limit_conn addr 1;
69 } 69 }
72 </para> 72 </para>
73 73
74 <para> 74 <para>
75 When several <code>limit_conn</code> directives are specified, 75 When several <code>limit_conn</code> directives are specified,
76 any configured limit will apply. 76 any configured limit will apply.
77 For example, the following configuration will limit the number
78 of connections to the server per client IP and at the same time
79 will limit the total number of connections to the virtual host:
80 <example>
81 limit_conn_zone $binary_remote_addr zone=perip:10m;
82 limit_conn_zone $server_name zone=perserver:10m;
83
84 server {
85 ...
86 limit_conn perip 10;
87 limit_conn perserver 100;
88 }
89 </example>
90
77 </para> 91 </para>
78 92
79 <para> 93 <para>
80 These directives are inherited from the previous level if and 94 These directives are inherited from the previous level if and
81 only if there are no 95 only if there are no