×
Falcon
2023-03-27 01:16
#稍后阅读# nginx 的限访问频率的 ngx_http_limit_req 模块,排除性限制如何做


https://serverfault.com/questions/177461/how-to-rate-limit-in-nginx-but-including-excluding-certain-ip-addresses
https://www.v2ex.com/t/927189

# 蜘蛛白名单
map $http_user_agent $limit{
default $binary_remote_addr;
~*(Baiduspider|360Spider|bingbot|Googlebot|Sogou|YoudaoBot|Sosospider) "";
}
limit_req_zone $limit zone=myqps:30m rate=2r/s;

limit_req zone=qps burst=10 nodelay;
limit_req_status 429;

0

暂无评论