| Syntax: | limit_conn zone number |
| Default: | |
| Context: | http server location |
| Reference: | limit_conn |
Sets the maximum allowed number of connections for a given zone. When this limit is exceeded, the server will return a status error 503 (Service Temporarily Unavailable) in reply to the request.
Multiple limit directives for different zones can be used in the same context and each will apply.
Standard nginx inheritance applies. Lower contexts will inherit from higher context so long as there are no similar directives in the current context.
| Syntax: | limit_conn zone number |
| Default: | |
| Context: | http server location |
| Reference: | limit_conn |
Directive assigns the maximum number of simultaneous connections for one session. With exceeding of this number the request completes by the code "Service unavailable" (503).
For example, the directive:
limit_zone one $binary_remote_addr 10m; server { location /download/ { limit_conn one 1; }
This allows not more than one simultaneous connection from one address.