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;
}
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;
}
相关文章推荐
- 根据查询的关键字,实现获取百度指定页数的搜索结果的信息(网页地址,标题,摘要,并有排序的说明)
- 验证配置设置时发生错误,已引发类型为System.Runtime.InteropServices.COMException的异常。其他异常信息:系统找不到指定的路径
- asp.net 2.0下根据权限动态控制菜单、动态配置导航信息
- Java中框架的概念,以及从配置文件中读取配置信息并加载指定类
- 骗子改电脑配置信息兜售垃圾,怕上当进来学习一下
- nginx配置信息的解析流程
- 根据指定的信息,调用远程WebService方法
- Android根据包名取得指定程序包的信息(名称、图标……)
- Implementations of interface through Reflection 反射根据继承的信息查找指定的类
- 根据报表文件名称关键字查找报表的执行文件名称等信息
- Windows 7删除任务栏Shell_NotifyIcon添加过的垃圾图标显示配置信息
- 如何通过配置log4j.xml来打印指定类或指定级别的日志信息
- sql 根据 分数 获取指定名次信息
- log4j配置文件配置指定的包的信息输出到指定的文件中去
- nginx和tomcat的配置信息
- C#指定config配置文件读取信息
- 大文件上传代码,根据下拉列表框选中的市县镇名保存文件到指定目录下,并将文件相关信息写进数据库
- 根据窗口名称查找关键字弹性域用到的表,列等信息
- 根据csv文件动态创建nginx配置文件(用于反向代理,perl描述)
- Java中框架的概念,以及从配置文件中读取配置信息并加载指定类