Skip to content

Instantly share code, notes, and snippets.

View posir's full-sized avatar
🏠
Working from home

Po Siraj posir

🏠
Working from home
  • Vancouver,CA
View GitHub Profile
#!/usr/bin/env bash
#wget -c https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-user-agents.list
curl -s -o bad-user-agents.list https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-user-agents.list
INPUT="bad-user-agents.list"
OUTPUT="custom-badbots.conf"
{
echo "map \$http_user_agent \$bad_bot {"
@posir
posir / cloudflare_realip.conf
Created April 7, 2024 06:14
cloudflare real ip
set_real_ip_from 173.245.48.0/20;
set_real_ip_from 103.21.244.0/22;
set_real_ip_from 103.22.200.0/22;
set_real_ip_from 103.31.4.0/22;
set_real_ip_from 141.101.64.0/18;
set_real_ip_from 108.162.192.0/18;
set_real_ip_from 190.93.240.0/20;
set_real_ip_from 188.114.96.0/20;
set_real_ip_from 197.234.240.0/22;
set_real_ip_from 198.41.128.0/17;
@posir
posir / badblock.conf
Created April 7, 2024 06:08
block bad ua/bot
# https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/blob/master/conf.d/globalblacklist.conf
map $http_user_agent $bad_bot {
default 0;
# START BAD BOTS ### DO NOT EDIT THIS LINE AT ALL ###
"~*(?:\b)01h4x.com(?:\b)" 3;
"~*(?:\b)360Spider(?:\b)" 3;
"~*(?:\b)404checker(?:\b)" 3;
"~*(?:\b)404enemy(?:\b)" 3;