简体   繁体   English

如何阻止引荐来源垃圾邮件

[英]How to block Referrer Spam

I am using NGINX and one of my site is suffering from referrer spam. 我正在使用NGINX,而我的网站之一却存在引荐来源垃圾邮件。

I followed the NGINX wiki, and I found this but after using the code, it is blocking my site. 我遵循了NGINX Wiki,发现了这一点,但是在使用代码后,它阻止了我的网站。 Is there any solution? 有什么解决办法吗? I have also tried using this code but it didn't worked 我也尝试使用此代码,但没有成功

if ($http_referer ~ "spamdomain1\.com|spamdomain2\.com|spamdomain3\.com")  { 
return 444;
}

I want to block the domain from where I am getting referrer hits. 我想屏蔽来自引荐来源网址的域名。

I would use a map. 我会用地图。

# at the http level:
map $http_referer $drop_referer {
    default 0;
    ~spamdomain1\.com   1;
    ~spamdomain2\.com   1;
    ~spamdomain3\.com   1;
    # ... (put these in an included file if there are many)
}

# in your server stanza:
if ($drop_referer) {
    return 444;
}

We began working on our internal tool ReferrerSpamBot that helps adding the dynamic filters to your Google Analytics account and also we want to develop a module for nginx in the future. 我们开始研究内部工具ReferrerSpamBot ,该工具可将动态过滤器添加到您的Google Analytics(分析)帐户,并且我们也希望将来为nginx开发一个模块。 Check out the project on GitHub GitHub上查看项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM