Skip to content

Instantly share code, notes, and snippets.

@metalagman
Last active September 12, 2016 01:12
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save metalagman/33d8aeeca513bba02222 to your computer and use it in GitHub Desktop.
Save metalagman/33d8aeeca513bba02222 to your computer and use it in GitHub Desktop.
HTTP referer spam blocking for nginx
map $http_referer $bad_referer {
hostnames;
default 0;
.semalt.com 1;
.kambasoft.com 1;
.savetubevideo.com 1;
.descargar-musica-gratis.net 1;
.7makemoneyonline.com 1;
.baixar-musicas-gratis.com 1;
.iloveitaly.com 1;
.iloveitaly.co 1;
.ilovevitaly.ru 1;
.fbdownloader.com 1;
.econom.co 1;
.buttons-for-website.com 1;
.buttons-for-your-website.com 1;
.free-share-buttons.com 1;
.srecorder.co 1;
.darodar.com 1;
.priceg.com 1;
.blackhatworth.com 1;
.adviceforum.info 1;
.hulfingtonpost.com 1;
.best-seo-offer.com 1;
.best-seo-solution.com 1;
}
# Insert this in server configuration:
# if ($bad_referer) {
# return 444;
# }
@lonegoat
Copy link

This is a great list. We've been putting together a similar list which contains even more spam referral sites which you might want to add to your list. Sadly our list is constantly growing so please keep visiting it. http://lonegoatuk.tumblr.com/post/107307494431/google-analytics-referral-spambot-list

@ralyodio
Copy link

how do i use this?

edit: found the answer here http://stackoverflow.com/a/33578063/33522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment