When using Nginx limit_req module, the Limit_req_zone has two variables, it will be an error.
"Nginx Limit_req module can only have one variable, and Tenginx can support more than one, specific can see the official website of the module introduction, very pit, change the Tenginx can"
Http://www.ithov.com/linux/114606.shtml
Http://nginx.org/en/docs/http/ngx_http_limit_req_module.html
Nginx Error:
[Root@www ~]#/root/nginx_reload
Nginx: [Emerg] Invalid number of arguments in "Limit_req_zone" directive in/usr/local/nginx/conf/nginx.conf:52
Nginx:configuration file/usr/local/nginx/conf/nginx.conf Test Failed
Limit_req Requirements:
Same IP source same URI 15r/m
same IP Source 30r/m
HTTP segment:
Geo $white _IP {
Ranges
Default 0;
127.0.0.1-127.0.0.255 1;
192.168.168.1-192.168.168.254 1;
}
Limit_req_zone $binary _remote_addr $uri zone=reqzone:20m rate=15r/m;
Limit_req_zone $binary _remote_addr zone=req_ip:10m rate=30r/m;
Limit_req_whitelist geo_var_name=white_ip geo_var_value=1;
Server segment:
Location ~ ^/test/.*\.html {
Limit_req Zone=reqzone burst=5 Nodelay;
Limit_req zone=req_ip burst=5 Nodelay;
Proxy_pass Http://WEB_APP;
Proxy_redirect off;
Proxy_set_header Host $host;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
}
The difference between Nginx and Tenginx's Limit_req module