Caddy2反向代理Onedrive/Sharepoint加速访问
记录一下Caddy2反向代理Onedrive/Sharepoint加速访问的配置,网上大部分还是Caddy1的配置说明,目前已经失效,Caddy默认版本已经切换为Caddy2。
Caddy官方安装文档:
修改配置文件:
/etc/caddy/Caddyfile
#your.custom.domain 自定义域名
#yourid 是 Onedrive/Sharepoint 中 *-my.sharepoint.com 的*部分
#yourid-my.sharepoint.com是Onedrive的地址
your.custom.domain {
tls your@email.address
reverse_proxy https://yourid-my.sharepoint.com {
header_up Host yourid-my.sharepoint.com
header_up Referer https://yourid-my.sharepoint.com
header_up X-Forwarded-For {host}
header_up X-Real-IP {remote}
header_up User-Agent {>User-Agent}
header_up Accept-Encoding identity
}
}
接着执行重启命令:
caddy stop
caddy start
如果遇到格式异常:
cd /etc/caddy/
caddy fmt --overwrite