diff --git a/nix/home/programs/jellyfin/default.nix b/nix/home/programs/jellyfin/default.nix index 433680d..6c0fcba 100644 --- a/nix/home/programs/jellyfin/default.nix +++ b/nix/home/programs/jellyfin/default.nix @@ -35,7 +35,6 @@ http2 = true; extraConfig = '' - # Provide the ssl cert and key for the vhost #Some players don't reopen a socket and playback stops totally instead of resuming after an extended pause send_timeout 100m; @@ -60,10 +59,27 @@ # Nginx default client_max_body_size is 1MB, which breaks Camera Upload feature from the phones. # Increasing the limit fixes the issue. Anyhow, if 4K videos are expected to be uploaded, the size might need to be increased even more client_max_body_size 100M; - ''; + ''; + locations."/" = { proxyPass = "http://localhost:8096"; }; + + locations."/socket" = { + extraConfig = '' + # Proxy Jellyfin Websockets traffic + proxy_pass http://localhost: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; + ''; + }; }; }; }