Emby服反代教程

森岩
2025-03-27 / 0 评论 / 3 阅读 / 正在检测是否收录...
温馨提示:
本文最后更新于2025年04月18日,已超过232天没有更新,若内容或图片失效,请留言反馈。

普通emby服务器反代(caddy)

参考:
https://www.nodeseek.com/post-193544-1

1. 安装Caddy(先把域名解析到机器上)

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https curl
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开启启动和启动Caddy

sudo systemctl enable caddy
sudo systemctl start caddy

2. 配置caddy

文件路径 /etc/caddy

sudo vi /etc/caddy/Caddyfile

反代代码

your.domain.com { # 这里写你用的域名
        reverse_proxy https://target.domain:443 { # 这里写反代的域名
                header_up Host {upstream_hostport}
        }
}

3. 重启Caddy

sudo systemctl restart caddy

反代媒体流

参考:
https://blog.csdn.net/qq_19289995/article/details/129712901
https://friendhosting.net/cn/blog/install-nginx-on-debian-11.php

1. 安装NGINX(先把域名解析到机器上)

apt install nginx -y

2. 配置文件

  1. 进入/etc/nginx/sites-available这个目录下,新建一个文件名为embyzox,没有后缀
  2. 编辑embyxxx,内容如下
server {
    listen 80;
    server_name emby.xxx.xxx;  # 修改为你的域名

    location / {
        proxy_pass http://ip.zox.show:49301;  # 修改为你的后端服务地址(以Zox为例)
        # 以下保持原有配置
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-Protocol $scheme;
        proxy_set_header X-Forwarded-Host $http_host;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "";
        proxy_set_header Accept-Encoding "";
        proxy_http_version 1.1;
        proxy_cache off;
    }
}
  1. 在sites-enabled目录中创建一个符号链接到配置文件

    sudo ln -s /etc/nginx/sites-available/embyzox /etc/nginx/sites-enabled/

3. 重新加载 Nginx 配置

  1. 确认 Nginx 配置文件中没有语法错误:sudo nginx -t
  2. 如果没有错误,则重新加载 Nginx 配置:sudo systemctl restart nginx

    4. 去bot那里添加线路即可

0

评论

博主关闭了所有页面的评论