#拒绝user-agent为Go的访问返回403并且不记录日志
location / {
if ($http_user_agent ~* Go) {
access_log off;
return 403;
}
#访问后缀是.php等扩展名结尾的页面时返回403
location ~* \.(ini|cfg|dwt|lbi|php|zip|rar)$ {
return 403;
}
#nginx访问限速
在http标签中增加以下内容
limit_req_zone $binary_remote_addr zone=one:20m rate=20r/s;
limit_conn_zone $binary_remote_addr zone=addr:20m;
在server标签中增加以下内容
limit_conn addr 20;
limit_req zone=one burst=5 nodelay;
转载于:https://blog.51cto.com/2225052/2355630
1506

被折叠的 条评论
为什么被折叠?



