Nginx Concurrent Connection Control module Ngx_http_limit_conn_module

Source: Internet
Author: User

Module: Ngx_http_limit_conn_module

Function: Limit the number of concurrent connections according to the defined key

Example configuration:

HTTP {    limit_conn_zone $binary _remote_addr zone=addr:10m;    ...    server {        ...        location/api/{            limit_conn addr;            Limit_conn_status 503;}}}    

  

Description: The example defines key (zone=addr) as addrand allocates a memory size of 10m ( zone=addr:10m (if the storage space for the restricted domain is exhausted, for all subsequent requests, the server will return 503), the same IP ( $binary _remote_addr ) and server connections more than 10 ( Limit_conn Addr ) will be intercepted and returned to 503 ( Limit_conn_status 503 ) error code

Related directives:

  Limit_conn_zone

  Limit_conn

  Limit_conn_status

  Limit_conn_log_level

Instruction Detailed:
Limit_conn_zone syntax: Limit_conn_zone key zone=name:size (set restriction rule, zone name, and allocated memory size) configurable area: Httpkey: required, set limit rule, value can be text, Nginx variable or combination of the two; the Nginx variable $binary_remote_addr used in the instance represents the Concurrency name: Required option based on each IP limit; a custom region name; arbitrary string size: allocates memory

 

Limit_conn Syntax: limit_conn zone number; (using an interception rule defined by Limit_conn_zone and setting a specific limit number of connections) configurable area: HTTP, server, Locationzone: required, name defined by Limit_conn_zone (zone=name); Indicates which restriction rule is used to define the number: Required option; positive integer; Indicates the specific limit of connections

Limit_conn_status syntax: limit_conn_status code; Default: 503 Configurable area: HTTP, server, location means exceeding Limit_ The error code returned to the client after the requested number of Req is configured to use the minimum version of the Directive 1.3.15

  

Limit_conn_log_level syntax: Limit_conn_log_level info | Notice | Warn | Error default: Limit_conn_log_level error; Configurable zone: HTTP, server, location set the required logging level when the server rejects processing requests because the rate exceeds or delays request processing. Minimum version: 0.8.18

  

  

  

 

Nginx Concurrent Connection Control module Ngx_http_limit_conn_module

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.