[Server] Caddy 反向代理
Categories Server
Tags
Background
Steps
DNS 解析 / 开放端口


配置服务器
- 安装 Caddy
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl - 导入 Caddy 官方签名:
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' \ | sudo gpg --dearmor \ -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg - 添加软件源:
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' \ | sudo tee /etc/apt/sources.list.d/caddy-stable.list - 调整权限:
sudo chmod o+r /usr/share/keyrings/caddy-stable-archive-keyring.gpgsudo chmod o+r /etc/apt/sources.list.d/caddy-stable.list - 安装:
sudo apt updatesudo apt install -y caddy - 检查:
caddy versionsystemctl status caddy
API 反向代理
- 编辑配置:
sudo vim /etc/caddy/Caddyfileapi.meowpick.eagle233.top { reverse_proxy 127.0.0.1:11451 } - 保存后格式化:
sudo caddy fmt --overwrite /etc/caddy/Caddyfile - 验证配置:
sudo caddy validate --config /etc/caddy/Caddyfile - 如果看到配置有效,再重新加载:
sudo systemctl reload caddy - 确认状态:
systemctl status caddy
Page views: Loading... · Visitors: Loading...
Except where otherwise noted, original content on this site is dedicated to the public domain under CC0 1.0.
Powered by Hexo & Theme mdsuper
沪ICP备2026040813号