Created
June 20, 2015 01:07
-
-
Save rolandinsh/93cb9a5f08f52d7065b4 to your computer and use it in GitHub Desktop.
spammers in .sh file (by @lolwhoami)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Author: https://github.com/lolwhoami/referrer-spam-blacklist/commit/b25bb159d95c0fc82ea731750f0461bd85b72a91 | |
# use this inside 'server { ... }' | |
# | |
# include spammers.nginx.conf; | |
# if($bad_referer) { | |
# return 444; | |
# } | |
conf='./spammers.nginx.conf' | |
echo 'map $http_referer $bad_referer {' > $conf | |
echo ' default 0;' >> $conf | |
for line in `cat spammers.txt` | |
do | |
echo ' "~'$line'" 1;' >> $conf | |
done | |
echo '}' >> $conf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
for https://gist.github.com/rolandinsh/52197d4d4feb37dffe9b