Ngx_http_limit_req_module
 
Instructions
 
Syntax:limit_req_log_level Info | Notice | Warn | Error
Default:limit_req_log_level warn
Context:http
 
 
Same as Nginx.
 
 
Syntax:limit_req_zone $session _variable1 $session _variable2 ... zone=name_of_zone:size rate=rate
Default:-
Context:http
 
 
Similar to Nginx, it supports multiple variables and supports multiple Limit_req_zone settings. Like what:
Limit_req_zone $binary _remote_addr zone=one:3m rate=1r/s; Limit_req_zone $binary _remote_addr $uri zone=two:3m rate=1r/s; Limit_req_zone $binary _remote_addr $uri $args zone=thre:3m rate=1r/s;
The second instruction above indicates that the same IP address and access to the same URI will result in the restriction of entering the limit req (1 requests per second).
 
 
Syntax:limit_req [on/off] | Zone=zone Burst=burst [forbid_action=action] [Nodelay]
Default:-
Context:http, Server, location
 
 
The use of Zone,burst and Nodelay is the same as in the Nginx limit req module.
 
The support switch is turned on by default. and a location supports multiple limit_req instructions, and when there are multiple limit_req instructions, the relationship between these instructions is or, that is, when any one of the restrictions is triggered, the corresponding limit_req is executed.
 
Forbid_action represents the action to be performed by Nginx when the condition is triggered, the name location and the page (/) are supported, and the default is to return 503. Like what:
Limit_req_zone $binary _remote_addr zone=one:3m rate=1r/s; Limit_req_zone $binary _remote_addr $uri zone=two:3m rate=1r/s; Limit_req_zone $binary _remote_addr $uri $args zone=three:3m rate=1r/s; Location/{limit_req zone=one burst=5; limit_req zone=two forbid_action= @test1; limit_req zone=three burst=3 forbid_ Action= @test2; Location/off {limit_req off;} location @test1 {rewrite ^/test1.html;} location @test2 {rewrite ^/test2.html;}
 
Syntax:limit_req_whitelist Geo_var_name=var_name Geo_var_value=var_value
Default:-
Context:http, Server, location
 
 
Represents the whitelist, which works with the Geo module, where geo_var_name represents the variable name set by the Geo module and Geo_var_value represents the variable value set by the GEO module. Like what:
Geo $white _ip {ranges; default 0; 127.0.0.1-127.0.0.255 1;} limit_req_whitelist geo_var_name=white_ip geo_var_value=1;
The above indicates that IP 127.0.0.1-127.0.0.255 this interval will skip limit_req processing.