diff --git a/confs/global/map-referrer.conf b/confs/global/map-referrer.conf new file mode 100644 index 0000000..a1ee9b0 --- /dev/null +++ b/confs/global/map-referrer.conf @@ -0,0 +1 @@ +map $http_referer $bad_referrer { hostnames; default no; } diff --git a/confs/global/map-user-agent.conf b/confs/global/map-user-agent.conf new file mode 100644 index 0000000..10e61a5 --- /dev/null +++ b/confs/global/map-user-agent.conf @@ -0,0 +1 @@ +map $http_user_agent $bad_user_agent { default no; } diff --git a/scripts/referrers.sh b/scripts/referrers.sh index f702913..a49b987 100755 --- a/scripts/referrers.sh +++ b/scripts/referrers.sh @@ -1,9 +1,5 @@ #!/bin/sh -if [ ! -f "/etc/nginx/map-referrer.conf" ] ; then - echo "" > /etc/nginx/map-referrer.conf -fi - BLACKLIST="$(curl -s https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-referrers.list)" DATA="" IFS=$'\n' diff --git a/scripts/user-agents.sh b/scripts/user-agents.sh index c3ac5fe..bd250aa 100755 --- a/scripts/user-agents.sh +++ b/scripts/user-agents.sh @@ -1,9 +1,5 @@ #!/bin/sh -if [ ! -f "/etc/nginx/map-user-agent.conf" ] ; then - echo "" > /etc/nginx/map-user-agent.conf -fi - BLACKLIST="$(curl -s https://raw.githubusercontent.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker/master/_generator_lists/bad-user-agents.list)" DATA="" IFS=$'\n'