V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
The Go Programming Language
http://golang.org/
Go Playground
Go Projects
Revel Web Framework
liuyinltemp
V2EX  ›  Go 编程语言

板上有熟悉 caddy 的大牛吗?咨询一下 caddy 内容替换的问题?

  •  
  •   liuyinltemp · 2019-08-07 09:27:38 +08:00 · 3275 次点击
    这是一个创建于 1696 天前的主题,其中的信息可能已经有所发展或是发生改变。
    简单反向代理正常:
    xxx.com:443 {
    tls /usr/local/bin/cert/xxx.crt /usr/local/bin/cert/xxx.key
    root /www
    gzip
    index index.html
    proxy / https://github.com
    }
    增加内容替换后失败:
    xxx.com:443 {
    tls /usr/local/bin/cert/xxx.crt /usr/local/bin/cert/xxx.key
    root /www
    gzip
    index index.html
    proxy / https://github.com
    filter rule {
    path .*\.html
    search_pattern <footer class="footer mt-6">
    replacement <footer class="footer mt-6" style="display:none;">
    }
    }
    5 条回复    2019-08-07 11:49:27 +08:00
    liuyinltemp
        1
    liuyinltemp  
    OP
       2019-08-07 09:28:09 +08:00
    对了 caddy 有没有调试命令类似 nginx -t 这种?
    BOYPT
        2
    BOYPT  
       2019-08-07 09:32:51 +08:00
    search_pattern 里面跟的是正则,大概你的< >影响了
    Keyes
        3
    Keyes  
       2019-08-07 09:50:04 +08:00
    离题回复:“板上”我去这两个字至少有十多年没见过了
    MonoLogueChi
        4
    MonoLogueChi  
       2019-08-07 11:40:25 +08:00 via Android
    做 htmlencode 试一下
    janxin
        5
    janxin  
       2019-08-07 11:49:27 +08:00
    @liuyinltemp -validate
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2606 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 15:37 · PVG 23:37 · LAX 08:37 · JFK 11:37
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.