本文最后更新于122 天前,其中的信息可能已经过时
——基于Debian12
- 安装caddy
起手式
sudo apt update
sudo apt upgrade
sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
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 apt update
sudo apt install caddy
启用 Caddy 并设置开机自启
sudo systemctl start caddy
sudo systemctl enable caddy
- 配置caddy
caddyfile路径为/etc/caddy/Caddyfile,修改内容为中文部分
你的域名 {
file_server
tls 邮箱
request_body {
max_size 20MB
}
header {
X-Frame-Options "SAMEORIGIN"
X-XSS-Protection "1; mode=block"
X-Content-Type-Options "nosniff"
}
handle_path /000/* {
reverse_proxy https://emby推流域名 {
header_up Host {http.reverse_proxy.upstream.hostport}
header_up Referer "https://emby服务器域名/web/index.html"
}
}
reverse_proxy https://emby服务器域名 {
header_up Host {http.reverse_proxy.upstream.hostport}
header_down Location "https://emby推流域名/(.*)$" "https://你的域名/000/$1"
}
}
配置文件来自大佬000,帅!
systemctl reload caddy
大功告成🎇