limit_conn

Syntax: limit_conn zone number;
Default:
Context: stream, server

Sets the shared memory zone and the maximum allowed number of connections for a given key value. When this limit is exceeded, the server will close the connection. For example, the directives

limit_conn_zone $binary_remote_addr zone=addr:10m;

server {
    ...
    limit_conn addr 1;
}

allow only one connection per an IP address at a time.

When several limit_conn directives are specified, any configured limit will apply.

The directives are inherited from the previous level if and only if there are no limit_conn directives on the current level.

doc_nginx
2017-02-09 07:06:44
Comments
Leave a Comment

Please login to continue.