• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting SyncPlay Fails

     
    • 0 Vote(s) - 0 Average

    SyncPlay Fails

    SyncPlay Fails with wss:// Behind Correctly Configured Nginx - Diagnostic Proof Included
    xtendo
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2025 Jun
    Reputation: 0
    #1
    2025-06-28, 12:00 PM
    Hello everyone,
    I'm seeking expert help for a persistent SyncPlay issue. My setup is Jellyfin 10.10.7 on a SeedIt4.me (Ubuntu) seedbox, accessed via Nginx with a /jellyfin subpath.

    The main Jellyfin UI works perfectly. The problem is isolated to WebSockets.

    When a browser tries to use SyncPlay, the developer console shows the connection to wssConfused-face/[mydomain]/jellyfin/socket fails. The UI button is unresponsive.


    The Jellyfin Backend is Working Correctly. I have bypassed Nginx and tested the backend directly from the server's command line using curl. When I send a manual WebSocket upgrade request to http://127.0.0.1:8096/jellyfin/socket, Jellyfin responds correctly with HTTP/1.1 101 Switching Protocols. This proves the application itself is not the source of the failure.

    The Nginx and Jellyfin Configurations Are Correct. I have configured both Nginx and Jellyfin according to official documentation for a reverse proxy with SSL Termination and a subpath.

    Jellyfin network.xml: BaseUrl is set to /jellyfin and internal HTTPS is disabled.

    Nginx jellyfin.conf: I am using the standard headers: proxy_http_version 1.1; , proxy_set_header Upgrade $http_upgrade; , and proxy_set_header Connection "upgrade"; . Normal HTTP traffic is being proxied successfully.

    Despite both Jellyfin and Nginx being configured correctly, the proxied WebSocket handshake fails when initiated by a browser. Given that Jellyfin works correctly when contacted directly, but fails when the WebSocket request comes from the Nginx proxy, what could be causing this breakdown in the proxy translation? Could this be a bug in how Jellyfin/Kestrel handles proxied WebSocket connections on a subpath, or a subtle issue with the SeedIt4.me environment?

    Thank you for your time.
    niels
    Offline

    Core Team

    Posts: 269
    Threads: 4
    Joined: 2023 Jun
    Reputation: 15
    Country:Netherlands
    #2
    2025-06-29, 06:17 AM
    Because you're using a base URL the config needs to be slightly different. Can you share the complete content of your Nginx config (obviously hide your domain from it)
    [Image: GitHub%20Sponsors-grey?logo=github] [Image: Buy%20Me%20a%20Coffee-grey?logo=buymeacoffee]
    xtendo
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2025 Jun
    Reputation: 0
    #3
    2025-06-29, 09:59 AM
    (2025-06-29, 06:17 AM)niels Wrote: Because you're using a base URL the config needs to be slightly different. Can you share the complete content of your Nginx config (obviously hide your domain from it)

    Thanks so much for taking a look at this, I really appreciate it.

    That's what I suspected as well – that the /jellyfin subpath is the source of this subtle problem. I've tried many configurations, and I'm very interested to see what you think.

    Here is the complete content of my /etc/nginx/apps/jellyfin.conf file. This is the final, stable configuration that allows the main UI to work perfectly, but where SyncPlay (WebSocket) still fails.

    nginx
    # Main Jellyfin UI traffic - subpath /jellyfin
    location /jellyfin {
        # This proxy pass to the HTTP port is correct based on our tests.
        proxy_pass http://127.0.0.1:8096;
        
        proxy_set_header Host $host;
        proxy_http_version 1.1;

        # These headers are for WebSocket support.
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        
        # These headers tell Jellyfin it is behind a proxy.
        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-Ssl on;
        
        proxy_redirect off;
        proxy_buffering off;
    }


    For completeness, and to save you time, here is some additional context:

    The Jellyfin backend is correctly configured for this proxy. The file /etc/jellyfin/network.xml has <BaseUrl>/jellyfin</BaseUrl> set, and internal HTTPS is disabled (<EnableHttps>false</EnableHttps>).

    I also attempted using the advanced map directive in /etc/nginx/nginx.conf to set the Connection header, and I tried temporarily disabling http2 on the main listener. Neither of these attempts fixed the WebSocket issue.

    The core mystery is that a direct curl test to http://127.0.0.1:8096/jellyfin/socket from the server's command line works perfectly, but the same connection fails when proxied through Nginx.

    Thank you again for your help. Please let me know if you see anything out of place or if you need the contents of any other files.
    niels
    Offline

    Core Team

    Posts: 269
    Threads: 4
    Joined: 2023 Jun
    Reputation: 15
    Country:Netherlands
    #4
    2025-06-29, 10:07 AM
    That location block does look right to me. Comparing it to my own Nginx config one thing you could try it to also add a proxy_set_header for the X-Forwarded-Protocol header.

    For reference, here is my entire location block:
    Code:
            location / {
                    proxy_pass localhost;
                    proxy_set_header Host $host;

                    # X-Forwarded
                    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;

                    # WebSockets
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";

                    # Disable buffering when the nginx proxy gets very resource heavy upon streaming
                    proxy_buffering off;
                    proxy_cache off;
            }
    [Image: GitHub%20Sponsors-grey?logo=github] [Image: Buy%20Me%20a%20Coffee-grey?logo=buymeacoffee]
    xtendo
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2025 Jun
    Reputation: 0
    #5
    2025-06-29, 11:27 AM
    (2025-06-29, 10:07 AM)niels Wrote: That location block does look right to me. Comparing it to my own Nginx config one thing you could try it to also add a proxy_set_header for the X-Forwarded-Protocol header.

    For reference, here is my entire location block:
    Code:
            location / {
                    proxy_pass localhost;
                    proxy_set_header Host $host;

                    # X-Forwarded
                    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;

                    # WebSockets
                    proxy_set_header Upgrade $http_upgrade;
                    proxy_set_header Connection "upgrade";

                    # Disable buffering when the nginx proxy gets very resource heavy upon streaming
                    proxy_buffering off;
                    proxy_cache off;
            }

    Hi, thanks so much for the suggestions and for sharing your config. I really appreciate you taking the time to help.
    I have just updated my /etc/nginx/apps/jellyfin.conf file to include the two directives you recommended: proxy_set_header X-Forwarded-Protocol $scheme; and proxy_cache off; . Unfortunately, after saving the file, confirming the config with nginx -t , restarting Nginx, and doing a hard refresh in my browser, the problem remains exactly the same. The main UI works perfectly, but clicking to join a SyncPlay group is still unresponsive, and the WebSocket connection fails. For full transparency, so you can see exactly what was tried, here is the complete and final jellyfin.conf file that incorporates your suggestions and is still not working for SyncPlay:

    Code:
    # This specific block handles the WebSocket traffic for SyncPlay.
    # The "=" sign tells Nginx to match this exact path and stop.
    location = /jellyfin/socket {
        # Proxy to Jellyfin's standard HTTP port
        proxy_pass http://127.0.0.1:8096;
       
        # Required headers for WebSocket upgrade
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        # Standard proxy headers
        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;
    }

    # This block handles all normal UI and API traffic.
    location /jellyfin {
        # This proxy pass to the HTTP port is correct based on our tests.
        proxy_pass http://127.0.0.1:8096;

        proxy_set_header Host $host;
        proxy_http_version 1.1;

        # WebSocket headers (also included here for general compatibility)
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        # These headers tell Jellyfin it is behind a proxy.
        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-Ssl on;

        proxy_redirect off;
        proxy_buffering off;
        proxy_cache off;
    }
    niels
    Offline

    Core Team

    Posts: 269
    Threads: 4
    Joined: 2023 Jun
    Reputation: 15
    Country:Netherlands
    #6
    2025-06-30, 06:21 AM
    Try removing the location block for the /jellyfin/socket route as you've already configured the WebSocket support for all routes. If it then still doesn't work I merged your config with mine so try and see if that solves it.

    Code:
    location /jellyfin {
        # This proxy pass to the HTTP port is correct based on our tests.
        proxy_pass http://127.0.0.1:8096;
        proxy_set_header Host $host;

        # These headers tell Jellyfin it is behind a proxy.
        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 X-Forwarded-Ssl on;

        # WebSocket headers (also included here for general compatibility)
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_redirect off;
        proxy_buffering off;
        proxy_cache off;
    }
    [Image: GitHub%20Sponsors-grey?logo=github] [Image: Buy%20Me%20a%20Coffee-grey?logo=buymeacoffee]
    xtendo
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2025 Jun
    Reputation: 0
    #7
    2025-06-30, 11:57 AM
    (2025-06-30, 06:21 AM)niels Wrote: Try removing the location block for the /jellyfin/socket route as you've already configured the WebSocket support for all routes. If it then still doesn't work I merged your config with mine so try and see if that solves it.

    Code:
    location /jellyfin {
        # This proxy pass to the HTTP port is correct based on our tests.
        proxy_pass http://127.0.0.1:8096;
        proxy_set_header Host $host;

        # These headers tell Jellyfin it is behind a proxy.
        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 X-Forwarded-Ssl on;

        # WebSocket headers (also included here for general compatibility)
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";

        proxy_redirect off;
        proxy_buffering off;
        proxy_cache off;
    }

    I have just replaced my entire location /jellyfin block with the exact one you suggested, including the additional X-Forwarded-Host , X-Forwarded-Protocol , and proxy_cache off directives. Unfortunately, after restarting Nginx and performing a hard refresh, the result is exactly the same. The main Jellyfin UI works perfectly, but clicking to join a SyncPlay group is still unresponsive.

    I really appreciate you taking the time to help me diagnose this. Thank you again for your expertise.
    niels
    Offline

    Core Team

    Posts: 269
    Threads: 4
    Joined: 2023 Jun
    Reputation: 15
    Country:Netherlands
    #8
    2025-06-30, 12:13 PM
    The only thing I can think of is changing the proxy_pass directive. If that doesn't work I don't know what the issue could be.

    Try the following options (note the slash at the end in the first one):

    Code:
    proxy_pass http://127.0.0.1:8096/;
    Code:
    proxy_pass http://127.0.0.1:8096/jellyfin/;
    Code:
    proxy_pass http://127.0.0.1:8096/jellyfin;
    [Image: GitHub%20Sponsors-grey?logo=github] [Image: Buy%20Me%20a%20Coffee-grey?logo=buymeacoffee]
    xtendo
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2025 Jun
    Reputation: 0
    #9
    2025-06-30, 02:30 PM
    (2025-06-30, 12:13 PM)niels Wrote: The only thing I can think of is changing the proxy_pass directive. If that doesn't work I don't know what the issue could be.

    Try the following options (note the slash at the end in the first one):

    Code:
    proxy_pass http://127.0.0.1:8096/;
    Code:
    proxy_pass http://127.0.0.1:8096/jellyfin/;
    Code:
    proxy_pass http://127.0.0.1:8096/jellyfin;

    I tried the proxy_pass changes you recommended. Unfortunately, they either broke the site or didn't solve the SyncPlay issue, so I've reverted the configuration back to the last stable version. It looks like this isn't a simple configuration problem. I appreciate all your time trying to help debug it. Thanks again.
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode