From 3a40049ca283da785e33436a6868123f996e319a Mon Sep 17 00:00:00 2001 From: Noneangel <1888627+Noneangel@users.noreply.github.com> Date: Sun, 18 May 2025 19:20:27 +0200 Subject: [PATCH] Fix Jellyfin CORS --- jellyfin.subdomain.conf.sample | 10 +++++++--- jellyfin.subfolder.conf.sample | 6 ++++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/jellyfin.subdomain.conf.sample b/jellyfin.subdomain.conf.sample index 53a42d1..d8291a2 100644 --- a/jellyfin.subdomain.conf.sample +++ b/jellyfin.subdomain.conf.sample @@ -1,4 +1,4 @@ -## Version 2025/01/11 +## Version 2025/05/18 # make sure that your jellyfin container is named jellyfin # make sure that your dns has a cname set for jellyfin # if jellyfin is running in bridge mode and the container is named "jellyfin", the below config should work as is @@ -22,7 +22,9 @@ server { set $upstream_app jellyfin; set $upstream_port 8096; set $upstream_proto http; - add_header Access-Control-Allow-Origin "luna://com.webos.service.config" always; + if ($http_user_agent ~ Web0S) { + add_header Access-Control-Allow-Origin "luna://com.webos.service.config" always; + } proxy_pass $upstream_proto://$upstream_app:$upstream_port; proxy_set_header Range $http_range; @@ -35,7 +37,9 @@ server { set $upstream_app jellyfin; set $upstream_port 8096; set $upstream_proto http; - add_header Access-Control-Allow-Origin "luna://com.webos.service.config" always; + if ($http_user_agent ~ Web0S) { + add_header Access-Control-Allow-Origin "luna://com.webos.service.config" always; + } proxy_pass $upstream_proto://$upstream_app:$upstream_port; } diff --git a/jellyfin.subfolder.conf.sample b/jellyfin.subfolder.conf.sample index 72c5ab3..0e5e01d 100644 --- a/jellyfin.subfolder.conf.sample +++ b/jellyfin.subfolder.conf.sample @@ -1,4 +1,4 @@ -## Version 2025/01/11 +## Version 2025/05/18 # make sure that your jellyfin container is named jellyfin # if jellyfin is running in bridge mode and the container is named "jellyfin", the below config should work as is # if not, replace the line "set $upstream_app jellyfin;" with "set $upstream_app ;" @@ -15,7 +15,9 @@ location ^~ /jellyfin/ { set $upstream_app jellyfin; set $upstream_port 8096; set $upstream_proto http; - add_header Access-Control-Allow-Origin "luna://com.webos.service.config" always; + if ($http_user_agent ~ Web0S) { + add_header Access-Control-Allow-Origin "luna://com.webos.service.config" always; + } proxy_pass $upstream_proto://$upstream_app:$upstream_port; proxy_set_header Range $http_range;