Nginx-ru mailing list archive (nginx-ru@sysoev.ru)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ngx http limit req module и реально е применение
On 17 Jul 2011 19h05 WEST, nginx-forum@xxxxxxxx wrote:
Try:
http {
(...)
limit_req_zone $binary_remote_addr zone=alfa:10m rate=1000r/s;
limit_req_zone $binary_remote_addr zone=beta:10m rate=1r/s;
geo $black {
default 1;
include /etc/black;
}
(...)
}
server {
(...)
location / {
error_page 418 = @beta;
if ($black) {
return 418;
}
limit_req zone=alfa;
}
location @beta {
limit_req zone=beta;
(...)
}
}
--- appa
> Спасибо огромное:) А подскажите еще,
> могу ли я организовать блек и вайт
> списки вот таким путем:
>
> geo $white{
> default 1;
> include /etc/white;
> }
>
> geo $black{
> default 1;
> include /etc/black;
> }
>
> if ($while){
> set $limit_req_zone $binary_remote_addr zone=beta:10m rate=1000r/s;;
> }
>
> if ($black){
> set $limit_req_zone $binary_remote_addr zone=beta:10m rate=1r/s;;
> }
>
> #### end cfg
> # cat white.txt
> 8.8.8.8 0;
> 4.4.4.4 0;
> # cat black.txt
> 207.46.197.32 0;
> 207.46.232.182 0;
_______________________________________________
nginx-ru mailing list
nginx-ru@xxxxxxxxx
http://nginx.org/mailman/listinfo/nginx-ru
|