Module ngx_http_limit_conn_module | english русский 简体中文 עברית 日本語 türkçe news about download security advisories documentation pgp keys faq links books support donation trac wiki nginx.com | ||||||||||||||||||||||||
The Not all connections are counted; only those that have requests currently being processed by the server, in which request header has been fully read. Example Configuration
http { limit_conn_zone $binary_remote_addr zone=addr:10m; ... server { ... location /download/ { limit_conn addr 1; }
Directives
Sets a shared memory zone and the maximum allowed number of connections for a given key value. When this limit is exceeded, the server will return error 503 (Service Temporarily Unavailable) in reply to a request. For example, the directives limit_conn_zone $binary_remote_addr zone=addr:10m; server { location /download/ { limit_conn addr 1; } allow for only a single connection at a time, per unique IP address.
When several limit_conn_zone $binary_remote_addr zone=perip:10m; limit_conn_zone $server_name zone=perserver:10m; server { ... limit_conn perip 10; limit_conn perserver 100; }
These directives are inherited from the previous level if and
only if there are no
This directive appeared in version 0.8.18. Sets the desired logging level for cases when the server limits the number of connections.
Sets parameters of a shared memory zone that keeps states for various keys. This state stores the current number of connections in particular. The key is any non-empty value of the specified variable (empty values are not accounted). Example usage: limit_conn_zone $binary_remote_addr zone=addr:10m;
Here, an IP address of the client serves as a key.
Note that instead of
This directive is made obsolete in version 1.1.8, an equivalent limit_conn_zone directive with a changed syntax should be used instead:
|