tengine 黑白名单

http {

...

geo $whiteiplist {
  default 1;
  include limit/whiteip.conf;
}

map $whiteiplist $limit {
  1 $binary_remote_addr;
  0 "";
}
limit_conn_zone $limit zone=myzone_bbs:10m;
limit_req_zone $limit zone=one:10m rate=15r/s

...

}

location / {

...

limit_conn myzone_bbs 20;
limit_req zone=one burst=15 nodelay;

...

}

vi limit/whiteip.conf

58.xx.xx.xx 0;    #允许

210.xx.xx.xx 1;   #拒绝

 

posted @ 2015-08-18 11:35  xiaohui163  阅读(293)  评论(0编辑  收藏  举报