nginx过滤ApacheBench和WordPress的简单cc请求攻击

/ 0评 / / 0

加入server段然后reload配置可以过滤掉低能的cc攻击。

if ($http_user_agent ~* (ApacheBench|pingback|WordPress|MJ12bot|AhrefsBot|360JK|PHP|php|Jorgee) ) {return 400;}
if ($http_user_agent = "" ) {return 101;}
if ( $request = "POST /reg.html HTTP/1.1" ) {return 400;}
if ( $request = "POST / HTTP/1.1" ) {return 400;}
if ( $request = "POST / HTTP/1.0" ) {return 400;}
if ( $request = "POST // HTTP/1.0" ) {return 400;}

发表评论

电子邮件地址不会被公开。 必填项已用*标注