Nginx new syntax Limit_conn_zone replace limit_conn usage

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.