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

caddy 反向代理求助

  •  
  •   Rehtt · 2019-10-18 11:06:19 +08:00 · 1592 次点击
    这是一个创建于 1623 天前的主题,其中的信息可能已经有所发展或是发生改变。

    假如我有 a.com b.com 这两个网站,我想将 b.com 内容代理到 a.com/b 下.请问该怎么配置,我配置的会访问 a.com/b 时请求的是 b.com/b 导致失败

    1 条回复    2019-10-18 14:51:01 +08:00
    Rehtt
        1
    Rehtt  
    OP
       2019-10-18 14:51:01 +08:00
    只想到了这个办法,可是还是不完美
    a.com {
    gzip
    redir 302{
    if_op and
    if {>Referer} has /b
    if {path} not_has /b
    / /b/{path}
    }
    proxy /b b.com {
    without /b
    }
    }
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2990 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 14:50 · PVG 22:50 · LAX 07:50 · JFK 10:50
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.