nginx deny rules conf

This commit is contained in:
myvesta 2024-11-19 15:17:29 +01:00 committed by GitHub
parent a2ed0dbf7a
commit 015b3c4571
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -72,6 +72,11 @@ $iptables -I fail2ban-$chain 1 -s $ip \
# Changing permissions
chmod 660 $conf
# nginx deny rules conf
if [ "$chain" = "WEB" ] && [ -f "/etc/nginx/conf.d/block.conf" ]; then
echo "deny $ip;" >> /etc/nginx/conf.d/block.conf
systemctl reload nginx
fi
#----------------------------------------------------------#
# Vesta #

View file

@ -53,6 +53,11 @@ $iptables -D fail2ban-$chain $b 2>/dev/null
# Changing permissions
chmod 660 $conf
# nginx deny rules conf
if [ "$chain" = "WEB" ] && [ -f "/etc/nginx/conf.d/block.conf" ]; then
sed -i "/deny $ip;/d" /etc/nginx/conf.d/block.conf
systemctl reload nginx
fi
#----------------------------------------------------------#
# Vesta #