Nginx has changed limit_conn to Limit_conn_zone since the release of the 1.1.8 version. The corresponding configuration file needs to be modified.
Official announcement:
Syntax:limit_zone name $variable size;
default:-
Context:http
This directive was made obsolete in version 1.1.8, an equivalent limit_conn_zone directive with a changed syntax should be Used instead:
Limit_conn_zone $variable zone=name:size;
Description of Limit_conn_zone:
When several limit_conn directives is specified, any configured limit would apply. For example, the following configuration would limit the number of connections to the server per client IP and at the same Time would limit the total number of connections to the virtual host:
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 is inherited from the previous level if and only if there is no limit_conn directives on the current Le Vel.
corresponding to the nginx.conf file in the Conf folder, replace Limit_conn with Limit_conn_zone. Used in HTTP
Example:
Limit_conn_zone $binary _remote_addr zone=perip:10m; #容器共使用10M的内存来对于IP传输开销
The corresponding virtual host file, replacing the original Limit_conn one with the Limit_conn Perip. Using the server
Example:
Limit_conn Perip 10; # Use 10 connections per IP.
Nginx new syntax Limit_conn_zone replace limit_conn usage