V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
NGINX
NGINX Trac
3rd Party Modules
Security Advisories
CHANGES
OpenResty
ngx_lua
Tengine
在线学习资源
NGINX 开发从入门到精通
NGINX Modules
ngx_echo
boro
V2EX  ›  NGINX

这条 nginx.conf 规则可以有效防垃圾评论么?

  •  
  •   boro · 2015-05-20 18:21:29 +08:00 · 3223 次点击
    这是一个创建于 3270 天前的主题,其中的信息可能已经有所发展或是发生改变。
    if ( $http_referer ~* (babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) )
    {
    return 404;
    return 403;
    }

    就算在(babes|forsale|girl|jewelry|love|nudit|organic|poker|porn|sex|teen) 加入垃圾评论对应的关键字,对方还是依然可以发布垃圾评论。
    16 条回复    2015-05-21 20:38:23 +08:00
    ericls
        1
    ericls  
       2015-05-20 18:27:36 +08:00
    你这个是判断来路 应该不能阻止 post 数据
    quix
        2
    quix  
       2015-05-20 18:30:58 +08:00
    加验证码吧
    Gonster
        3
    Gonster  
       2015-05-20 18:44:23 +08:00 via iPhone
    (・_・; lz先查一下 http referer就知道了
    loading
        4
    loading  
       2015-05-20 19:03:13 +08:00 via Android
    自己试一次吧,谁会用那样reffer的程序…
    Csineneo
        5
    Csineneo  
       2015-05-20 19:29:53 +08:00
    對 post url 限制空的 referer 的效果比這個要好得多
    boro
        6
    boro  
    OP
       2015-05-20 19:32:31 +08:00
    @Csineneo 求相关教程
    boro
        7
    boro  
    OP
       2015-05-20 19:32:52 +08:00
    @ericls 有没有好方法推荐?
    binux
        8
    binux  
       2015-05-20 19:36:29 +08:00 via Android   ❤️ 1
    难道不应该问一句,你是怎么觉得它能的?
    boro
        9
    boro  
    OP
       2015-05-20 22:07:18 +08:00
    @binux 看了几个国外的blog 说这也是一条手段
    lincanbin
        10
    lincanbin  
       2015-05-20 22:07:58 +08:00
    @boro 哪个Blog发来瞧瞧?
    xi_lin
        12
    xi_lin  
       2015-05-20 23:13:59 +08:00
    国外的refer列表不见得在国内好用
    anyforever
        13
    anyforever  
       2015-05-21 09:22:13 +08:00
    你上面限的post内容还是来路网址中带这些啊?
    如果是内容中的,那必然不管用。
    otakustay
        14
    otakustay  
       2015-05-21 18:23:43 +08:00
    完全没用,我曾经都把规则设为“至少要有一个中文”,还是一堆一堆的垃圾评论
    boro
        15
    boro  
    OP
       2015-05-21 20:31:47 +08:00
    @anyforever 内容
    boro
        16
    boro  
    OP
       2015-05-21 20:38:23 +08:00
    @anyforever 网址带有也无效
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2205 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 02:32 · PVG 10:32 · LAX 19:32 · JFK 22:32
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.