V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX 提问指南
YAFEIML
V2EX  ›  问与答

求个 nginx 伪静态规则

  •  
  •   YAFEIML · 2014-12-25 17:22:06 +08:00 · 1795 次点击
    这是一个创建于 3413 天前的主题,其中的信息可能已经有所发展或是发生改变。
    2 条回复    2014-12-25 22:27:50 +08:00
    yrdr
        1
    yrdr  
       2014-12-25 17:51:56 +08:00
    Location ~ \.torrent$ {
    if (!-e $request_filename) {
    rewrite ^/download/((?!\.torrent)[\w_\.]+)\.torrent$ /download.php?filename=$1&fileurl=http://www.xxx.com/asdasdsadasd.torrent last;
    }
    }
    你这里写得很不明白,asdasdsadasd.torrent明明应该是真正的文件啊?你除非是在数据库里面写好对应的路由,否则怎么可能达到你要的要求?
    P.S 以上规则只是凭经验写的,未经过测试,错了也别喷
    YAFEIML
        2
    YAFEIML  
    OP
       2014-12-25 22:27:50 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1457 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 17:04 · PVG 01:04 · LAX 10:04 · JFK 13:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.