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

请教一个 Caddy 反代的问题

  •  
  •   nyanyh · 2018-04-12 14:55:42 +08:00 · 1478 次点击
    这是一个创建于 2210 天前的主题,其中的信息可能已经有所发展或是发生改变。

    有个开了 CloudFront CDN 的网站,国内访问很慢,在自己服务器上做了个反代

    需求:访问 uwccsc.example.com 相当于访问源网站

    Caddyfile 配置如下:

    https://uwccsc-static.example.com {
        tls <email>
    
        proxy / https://assets.prod.managebac.com {
            header_upstream Host assets.prod.managebac.com
            header_upstream Accept-Encoding identity
        }
    
    }
    
    https://uwccsc.example.com {
        tls <email>
    
        proxy / https://uwccsc.managebac.com {
            header_upstream Host uwccsc.managebac.com
            header_upstream Accept-Encoding identity
        }
    
        filter rule {
            content_type text/.*
            search_pattern assets.prod.managebac.com
            replacement uwccsc-static.example.com
        }
    
        filter rule {
            content_type text/.*
            search_pattern uwccsc.managebac.com
            replacement uwccsc.example.com
        }
    
    }
    
    

    这个网站,访问uwccsc.managebac.com/parent的时候如果未登录会跳转到uwccsc.managebac.com/login,但是在我的域名上访问uwccsc.example.com/parent的时候会直接跳转回源网站而不是uwccsc.example.com/parent,这个反代应该怎样配置呢

    目前尚无回复
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5396 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 07:02 · PVG 15:02 · LAX 00:02 · JFK 03:02
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.