Jellyfin Forum
playback error over nginx but works perfect over LAN. - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+---- Forum: Networking & Access (https://forum.jellyfin.org/f-networking-access)
+---- Thread: playback error over nginx but works perfect over LAN. (/t-playback-error-over-nginx-but-works-perfect-over-lan)



playback error over nginx but works perfect over LAN. - finhpc - 2023-06-22

I set up my jellyfin server on windows. For the past week its been working perfectly over my local network, I wanted remote access. I already had Nginx proxy manager running in a docker container hosting other services. When I go to jellyfin.mydomain.com I can login and browse my media. I can also watch a few videos that have the webm format.( playback info of working video https://ibb.co/MgCX124 ) But the majority of things I try and play they show a playback error. https://ibb.co/n3c2jNp . 
In the Nginx proxy manager advanced configuration I added


Code:
   
   location / {
        # Proxy main Jellyfin traffic
        proxy_pass $forward_scheme://$server:$port;
        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;
        # Disable buffering when the nginx proxy gets very resource heavy upon #treaming
        proxy_buffering off;
    }

location /embywebsocket {
        # Proxy Jellyfin Websockets traffic
        proxy_pass $forward_scheme://$server:$port;
        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;
  }

this was after reading the comments on this post https://www.reddit.com/r/jellyfin/comments/d7a16g/jellyfin_behind_nginx_proxy_manager/

I tried adding this from the official Nginx guide but it causes Nginx proxy manager to show the status as offline.
   
Code:
# Jellyfin
    location /jellyfin {
        return 302 $scheme://$host/jellyfin/;
    }
    location /jellyfin/ {
        # Proxy main Jellyfin traffic
        # The / at the end is significant.
        # https://www.acunetix.com/blog/articles/a-fresh-look-on-reverse-proxy-related-attacks/
        proxy_pass http://$jellyfin: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_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $http_connection;
        # Disable buffering when the nginx proxy gets very resource heavy upon streaming
        proxy_buffering off;
    }
}


Nginx config 1

Nginx SSL config

Please let me know if i could help you with any information I may have missed. thank you very much for all of the help.


RE: playback error over nginx but works perfect over LAN. - skribe - 2023-06-24

I'm really not sure who created the configs you're using, but there are several things that look incorrect. Instead of trying to clean them up as they exist, let me just refer you to our nginx documentation here, where we have example configs: https://jellyfin.org/docs/general/networking/nginx/

You should be able to use the example configs with a few very minor modifications.