nginx封锁IP,并且定时取消

2015-06-20 0 817
nginx封锁IP,并且定时取消
#!/bin/bash
max=5
confdir=/usr/local/nginx/conf/blockip.conf
logdir=/usr/local/nginx/logs/access.log
echo "">$confdir
cat $logdir|awk '{print $1}'|sort|uniq -c|sort -n|while read line
do
a=(`echo $line`)
if [ $a -ge $max ]
then
 echo "deny ${a[1]};">>$confdir
fi
done
service nginx reload
at now+2 minutes -f /root/unblockip.sh

遇见资源网 shell nginx封锁IP,并且定时取消 http://www.ox520.com/17015.html

常见问题

相关文章

发表评论
暂无评论
官方客服团队

为您解决烦忧 - 24小时在线 专业服务