How to block some IP if the website is behind CloudFlare

Post Reply
User avatar
T4B
Posts: 171
Joined: Sat Jul 11, 2020 9:44 am
Been thanked: 5 times

hey i did block a ip address from firewall
but the ip still connect the site
then i block it using cloudflare then stops traffic
server firewall ignore if i have enabled cloudflare for the website ?
User avatar
T4B
Posts: 171
Joined: Sat Jul 11, 2020 9:44 am
Been thanked: 5 times

Use the following commands to block ip:

Code: Select all

touch /etc/nginx/conf.d/block.conf

echo "deny 111.222.111.222;" >> /etc/nginx/conf.d/block.conf
# just put IP you want to ban instead of 111.222...

systemctl restart nginx
Post Reply