handle_path /imgs/* {
# blog.wdssmq.com/imgs/doc/001.png
reverse_proxy raw.githubusercontent.com {
header_up Host {upstream_hostport}
header_up X-Real-IP {remote}
}
rewrite * /wdssmq/Markdown-To-Z-Blog/main/{path}
# respond "{path}"
}
https://blog.wdssmq.com/imgs/doc/001.png
实际访问会跳转两次;
「折腾」 Caddy 简易入门教程_电脑网络_沉冰浮水:
1
Buges 2022-05-29 15:45:02 +08:00 via Android
因为上游 HTTP 返回的就是跳转。你应该反代到 HTTPS 。
|