您的位置:首页 > 运维架构 > Nginx

nginx根据关键字配置封杀指定来路的垃圾信息

2014-05-30 08:31 302 查看
Nginx: How To Stop Referrer Spam With Keyword Filtering

You can configure Nginx to stop referrer spam by checking for bad keywords like tramadol, phentermine etc. This reduces the load on your server as well as prevents filling your referrer logs with invalid entries. Here is my nginx configuration to stop referrer
spam (feel free to copy it):

# 403 forbidden based on http referer

if ($http_referer ~* "tramadol|viagra|levitra|adipex|virex|antispysoft2005\.com|mydivx\.info|my-pills\.be|cameralover\.net|credit-dreams\.com|the-discount-store\.com|bayfronthomes\.net|casino|poker|hackerssupply\.com|hydrocodone|cafexml\.com|yelucie\.com|crescentarian\.net|andrewsaluk\.com|tigerspice|doobu\.com|camfun24|latinonakedgirl|ronnieazza\.com|highprofitclub|dvdsqueeze\.com|sexsearchcom\.com|6q\.org|d4f\.de|adultactioncam|seventwentyfour\.com|genaholincorporated\.com|firsthorizonmtg\.com|personalsites\.info|bukakke-bukake-bukkake-bukkakke\.com|camgirlslive\.com|dvd-copy\.com|shaffelrecords\.com|mcr8\.com|dating\.blogs\.com|online-casino-pops|8thstreetlatinas|boysfirsttime\.com|gofordgo\.com|chile-online\.com|buy-hgh-human-growth-hormone\.net")
{

return 403;

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐