您的位置:首页 > 运维架构 > Nginx

Nginx + fail2ban 提高安全性

2015-09-21 10:59 507 查看
通过Nginx做web server时,发现error.log中有很多连接尝试,这个时候fail2ban可以比较好的对付这些爬虫,探测程序等。

1. Policy配置

2. 查找分析Log

因为fail2ban会定期备份日志,所以需要查看IP地址时需要对所有的log进行查找,可以用zgrep

zgrep -c 210.213. /var/log/fail2ban.

3. 配置文件

/etc/fail2ban/fail2ban.

4. Log rotate 配置
/etc/logrotate.d/fail2ban

5. Permanently Ban Repeat Offenders With Fail2Ban

https://wireflare.com/permanently-ban-repeat-offenders-with-fail2ban/

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: