Home >Backend Development >PHP Tutorial >nginx whitelist configuration beyond limiting the number of connections and requests nginx apache nginx php nginx rewrite
I have written two articles before to introduce nginx_http_limit_req_module and nginx_http_limit_conn_module, which respectively limit the number of user requests and connections. The whitelist is mainly to divide some internal personnel so that they are not affected by the restrictions.
You can read the previous article first:
nginx limits the number of requests
http://blog.csdn.net/wanglei_storage/article/details/51076882
nginx limits the number of connections
http://blog.csdn.net/wanglei_storage/article/details/51076561
Module View:
tening After compilation and installation, use sbin/nginx -V to view all modules, and whitelist configuration is required geo module support.
1. geo command
Syntax: geo $variable {……}
Default value: none
Configuration section: http
Parameter introduction:
default: nginx will use this value if the client address cannot match any of the defined addresses. If CIDR is used, "0.0.0.0/0" can be used instead of default.
ranges: Define the address in the form of an address segment. This parameter must be placed first. To speed up loading of the address library, addresses should be defined in ascending order.
2. Configuration usage example:
1) Limit the number of requests
limit_req_zone: used to define the limit request zone; includes client address, zone name, shared memory, and rate.
2) Limit the number of connections
limit_conn_zone: used to define a restricted connection area; includes area name and shared memory.
3) geo mainly defines the whitelist configuration, the variable is $white_ip, and the parameters and specific values are defined in { }.
Use limit_req_whitelist at the bottom to apply the configured whitelist, 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; all IPs in the whitelist are not subject to any restrictions.
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });The above introduces the whitelist configuration of nginx other than limiting the number of connections and requests, including nginx content. I hope it will be helpful to friends who are interested in PHP tutorials.