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

2019-08-07 09:27:38 +08:00
 liuyinltemp
简单反向代理正常:
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;">
}
}
3316 次点击
所在节点    Go 编程语言
5 条回复
liuyinltemp
2019-08-07 09:28:09 +08:00
对了 caddy 有没有调试命令类似 nginx -t 这种?
BOYPT
2019-08-07 09:32:51 +08:00
search_pattern 里面跟的是正则,大概你的< >影响了
Keyes
2019-08-07 09:50:04 +08:00
离题回复:“板上”我去这两个字至少有十多年没见过了
MonoLogueChi
2019-08-07 11:40:25 +08:00
做 htmlencode 试一下
janxin
2019-08-07 11:49:27 +08:00
@liuyinltemp -validate

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/589694

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX