YAFEIML
V2EX  ›  问与答

求个 nginx 伪静态规则

  •  
  •   YAFEIML · Dec 25, 2014 · 2400 views
    This topic created in 4333 days ago, the information mentioned may be changed or developed.
    2 replies  •  2014-12-25 22:27:50 +08:00
    yrdr
    yrdr
    Dec 25, 2014
    1
    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 以上规则只是凭经验写的,未经过测试,错了也别喷
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3037 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 11:44 · PVG 19:44 · LAX 03:44 · JFK 06:44
    ♥ Do have faith in what you're doing.