How to set a max access times within a limited time?

bai.xiaoyu at gmail.com bai.xiaoyu at gmail.com
Tue Jul 13 12:40:04 MSD 2010


I want to limit access to certain resources base on following rules:

1. each ip can only access the resources 333 times a day (or within
the last 24 hrs)

2. no more than X simultaneous connections and no more than Xr/s

Currently, nginx can handle rule 2 with the limit zone module.
http://wiki.nginx.org/NginxHttpLimitZoneModule

location /resource {
         limit_conn gullag 1;
         limit_req  zone=qincheng burst=1;
}

How do I go about rule 1?  Thank you!




More information about the nginx mailing list