V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
c00WKmdje2wZLrSI
V2EX  ›  程序员

请教 rewrite 的写法

  •  
  •   c00WKmdje2wZLrSI · 2018-09-17 17:24:05 +08:00 · 1968 次点击
    这是一个创建于 2019 天前的主题,其中的信息可能已经有所发展或是发生改变。

    搭了个乌云的镜像站,然后图片是外链的,但是现在外链挂了,于是我就把保存的图片传到 oss 上面,rewrite 一下,但是一直不成功,不知道哪里错了

    iZUqFe.png

    rewrite http://static.loner.fm/upload/(.*?)jpg$ https://xxxx.oss-cn-hangzhou.aliyuncs.com/$1jpg;

    重启 nginx 后未发现错误,重新访问页面后,还是访问原来的图片外链,没有跳转,是哪里写错了?

    4 条回复    2018-09-17 19:35:52 +08:00
    wlsnx
        1
    wlsnx  
       2018-09-17 17:55:51 +08:00
    c00WKmdje2wZLrSI
        2
    c00WKmdje2wZLrSI  
    OP
       2018-09-17 18:05:21 +08:00
    @wlsnx rewrite /upload/(.*?)jpg$ https://xxxx.oss-cn-hangzhou.aliyuncs.com/$1jpg;
    还是没跳转
    roadli
        3
    roadli  
       2018-09-17 19:03:22 +08:00
    因为这请求都根本发不到你服务器上啊 static.loner.fm. 7200 IN A 139.196.166.156
    c00WKmdje2wZLrSI
        4
    c00WKmdje2wZLrSI  
    OP
       2018-09-17 19:35:52 +08:00
    @roadli 哦.....原来是这样......
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5229 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 09:14 · PVG 17:14 · LAX 02:14 · JFK 05:14
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.