nginx配置黑名单封ip
·
面对垃圾留言和暴力破解,我们可以封禁IP,方法如下
1、nginx层面,还会有403进入日志,比较占用资源
# vi nginx.conf
Include /alidata/server/nginx-1.11.10/conf.d/*.conf
# vi blocksip.conf
deny 192.168.1.1;
deny 10.0.0.0/24;
# /etc/init.d/nginx restart
2、系统层面,比较彻底
iptables -I INPUT -s 192.168.1.1 -j DROP # 封ip
iptables -D INPUT -s 192.168.1.1 -j ACCEPT # 解封
自动化脚本封ip https://www.cnblogs.com/paul8339/p/11675561.html
更多推荐

所有评论(0)