为了在更新Emby、Jellydfin时不删除弹幕设置, 直接在反向代理上做些修改是最好的.
对于 Emby, 我们添加如下 Nginx 配置
location / {
proxy_pass http://192.168.31.120:8096;
proxy_pass_request_headers on;
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-Host $http_host;
# 在流式传输时禁用缓冲
proxy_buffering off;
}
location = /web/index.html {
proxy_pass http://192.168.31.120:8096/web/index.html;
proxy_pass_request_headers on;
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-Host $http_host;
# 禁用与后端压缩并侧载脚本
proxy_set_header Accept-Encoding "";
sub_filter '</body>' '<script src="https://cdn.jsdelivr.net/gh/chen3861229/dd-danmaku@new-ui/ede.js" defer></script></body>';
sub_filter_once on;
}
location /socket {
proxy_pass http://192.168.31.120:8096;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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;
}
这里的 192.168.31.120:8096
是 Emby 服务器的ip地址和端口.
对于 Jellyfin, 添加如下 Nginx 配置
location / {
proxy_pass http://192.168.31.120:8096;
proxy_pass_request_headers on;
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-Host $http_host;
# 在流式传输时禁用缓冲
proxy_buffering off;
}
location = /web/index.html {
return 301 /web/;
}
location = /web/ {
proxy_pass http://192.168.31.120:8096/web/;
proxy_pass_request_headers on;
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-Host $http_host;
# 禁用与后端压缩并侧载脚本
proxy_set_header Accept-Encoding "";
sub_filter '</body>' '<script src="https://jellyfin-danmaku.pages.dev/ede.user.js" defer></script></body>';
sub_filter_once on;
}
location /socket {
proxy_pass http://192.168.31.120:8096;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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;
}
对于 Plex, 由于不明原因反代设置失败, 请使用 Danmaku Anywhere 插件添加弹幕. 安装好插件后, 在装填配置处将 Plex 的 url 改为自己的 url, 适配选为 Plex 即可.
Comments NOTHING