I have written two articles in front of the introduction of Nginx_http_limit_req_module and Nginx_http_limit_conn_module, respectively, the number of user requests and the number of connections to limit, and the white list is mainly to some internal personnel division, and thus unaffected by limitations.
Take a look at the previous article:
Nginx Limit number of requests
http://blog.csdn.net/wanglei_storage/article/details/51076882
Nginx Limit number of connections
http://blog.csdn.net/wanglei_storage/article/details/51076561
Module View:
Tening use Sbin/nginx-v to view all modules after the compilation installation is complete, and the whitelist configuration requires GEO module support.
I. GEO directives
Syntax: Geo $variable {...}
Default value: None
Configuration segment: http
Parameter description:
Default: Nginx will use this value if the client address does not match any of the defined addresses. If you use CIDR, you can use "0.0.0.0/0" instead of default.
Ranges: Use the address segment to define the address, this parameter must be in the first place. To speed up the loading of the address library, the address should be defined in ascending order.
Second, the configuration use example:
1) Limit the number of requests
Limit_req_zone: Used to define the limit request area, including the client address, zone name and shared memory, rate.
2) Limit the number of connections
Limit_conn_zone: Used to define restricted connection areas, including zone names and shared memory.
3) GEO is primarily defined as a whitelist configuration, where variables are defined as $white _ip,{} and define parameters and specific values.
At the bottom, the whitelist configured with the Limit_req_whitelist app is used, 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, and the IP in all white lists is not subject to any restrictions.
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });
The above describes the Nginx limit connection and the number of requests in addition to the white list configuration, including Nginx content, I hope that the PHP tutorial interested in a friend helpful.