Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Stop SPAM Referrers on NGINX and Google Analytics
server {
# ...
location / {
# ...
# Stop SPAM Referrers
if ($http_referer ~* (Free-Traffic|babes|click|diamond|forsale|girl|jewelry|love|nudit|poker|porn|poweroversoftware|sex|teen|video|webcam|zippo|social-buttons|simple-share-buttons|free-share-buttons)){
return 403;
}
# ...
}
}
Free-Traffic|babes|click|diamond|forsale|girl|jewelry|love|nudit|poker|porn|poweroversoftware|sex|teen|video|webcam|zippo|social-buttons|simple-share-buttons|free-share-buttons
@Angelmmiguel

This comment has been minimized.

Copy link
Owner Author

@Angelmmiguel Angelmmiguel commented Apr 22, 2015

Regex based on this StackOverflow answer

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