- 指定 http 和 https 监听端口;
- 配置请求指向;
{
http_port 1234
https_port 2234
}
xxx {
reverse_proxy localhost:8081
tls {
dns lego_deprecated alidns
}
}
配置完成还不行,我们需要按照 lego_deprecated 的文档 ,建立文件,配置以下:
<span class="pln">ALICLOUD_ACCESS_KEY</span><span class="pun">=</span><span class="pln">xxx</span>
<span class="pln">ALICLOUD_SECRET_KEY</span><span class="pun">=</span><span class="pln">xxx</span>
关键参数(此部分参数需要从阿里云后台进行获取),便于联系对应 dns 进行相关的操作;
最后使用 caddy 指令带上配置好的文件直接启动
<span class="pln">caddy run </span><span class="pun">--</span><span class="pln">config </span><span class="typ">Caddyfile</span> <span class="pun">--</span><span class="pln">envfile alidns</span><span class="pun">.</span><span class="pln">env</span>
正文完
发表至: *NIX相关
2023-01-24