V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
ykjsw
V2EX  ›  问与答

求 nginx 防盗链方案

  •  
  •   ykjsw · Nov 11, 2016 · 2582 views
    This topic created in 3461 days ago, the information mentioned may be changed or developed.
    必要基于 referrer 的, accesskey 模块太老了,和新版 nginx 编译不成功。

    话说 防盗链英文如何翻译?
    3 replies    2016-12-21 20:03:14 +08:00
    Phant0m
        1
    Phant0m  
       Nov 11, 2016
    location ~ \.(gif|jpg|jpeg|png|ico)$ {
    valid_referers none blocked fanlychie.com www.fanlychie.com;

    if ($invalid_referer) {

    return 403;

    }

    expires 7d;
    }
    参考 http://fanlychie.github.io/post/nginx-anti-theft-chain.html
    ykjsw
        2
    ykjsw  
    OP
       Nov 11, 2016
    @Phant0m 谢谢,打错了,是不要 referrer 的,已经找到一个
    http://nginx.org/en/docs/http/ngx_http_secure_link_module.html
    正在测试
    LEFT
        3
    LEFT  
       Dec 21, 2016
    anti-theft chain
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2695 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 03:30 · PVG 11:30 · LAX 20:30 · JFK 23:30
    ♥ Do have faith in what you're doing.