The difference between Nginx and Tenginx's Limit_req module

Source: Internet
Author: User

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

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.