• 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 Networking & Access SOLVED: Severe stuttering via reverse proxy (nginx)

    Pages (2): 1 2 Next »

     
    • 0 Vote(s) - 0 Average

    SOLVED: Severe stuttering via reverse proxy (nginx)

    My Jellyfin instance shows severe stuttering when I try to stream 4K content via my nginx proxy, but runs perfectly fine when connecting directly
    Matth
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Mar
    Reputation: 0
    Country:Switzerland
    #1
    2026-06-01, 02:07 PM
    So, I have this issue that bugs me massively and I can't seem to figure out what the problem is. 

    I have Jellyfin 10.11.10 running in a docker container on an Intel NUC running Ubuntu 22.04.5 LTS. Content is coming from a mounted volume from a NAS.

    Jellyfin has plenty of content in all different qualities. When I connect directly to the server, i.e. 192.168.7.8:8096 I can stream all content perfectly fine and without a stutter. Full HD as well as various 4K content all running perfectly fine on my phone. When I run these movies or TV shows, the dashboard says it doesn't have to transcode, and simply feeds the file as it is.

    I also have an nginx reverse proxy setup. This one has port 80 and 443 open so that I can access Jellyfin (and other self-hosted services) from outside my home. My nginx conf is literally a copy from the sample on the Jellyfin website (https://jellyfin.org/docs/general/post-i...roxy/nginx). 

    Here is my copy of it:

    Code:
    server {

        server_name jellyfin.mydomain.com;

        ## The default `client_max_body_size` is 1M, this might not be enough for some posters, etc.
        client_max_body_size 20M;

        # use a variable to store the upstream proxy
        set $jellyfin 192.168.7.8;

        # Security / XSS Mitigation Headers
        add_header X-Content-Type-Options "nosniff";

        # Permissions policy. May cause issues with some clients
        add_header Permissions-Policy "accelerometer=(), ambient-light-sensor=(), battery=(), bluetooth=(), camera=(), clipboard-read=(), display-capture=(), document-domain=(), encrypted-media=(), gamepad=(), geolocation=(), gyroscope=(), hid=(), i>

        # Content Security Policy
        # See: https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP
        # Enforces https content and restricts JS/CSS to origin
        # External Javascript (such as cast_sender.js for Chromecast) must be whitelisted.
        add_header Content-Security-Policy "default-src https: data: blob: ; img-src 'self' https://* ; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' https://www.gstatic.com https://www.youtube.com blob:; worker-src 'self' blob>

        location / {
            # Proxy main Jellyfin traffic
            proxy_pass http://$jellyfin:8096;
            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 streaming
            proxy_buffering off;
        }

        location /socket {
            # Proxy Jellyfin Websockets traffic
            proxy_pass http://$jellyfin: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;
        }

        access_log /var/log/nginx/jellyfin.mydomain.com-access.log;
        error_log /var/log/nginx/jellyfin.mydomain.com-error.log info;

        listen 443 ssl; # managed by Certbot
        ssl_certificate /etc/letsencrypt/live/jellyfin.mydomain.com/fullchain.pem; # managed by Certbot
        ssl_certificate_key /etc/letsencrypt/live/jellyfin.mydomain.com/privkey.pem; # managed by Certbot
        include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
        ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    }
    server {
        if ($host = jellyfin.mydomain.com) {
            return 301 https://$host$request_uri;
        } # managed by Certbot

        listen 80 http2;

        server_name jellyfin.mydomain.com;
        return 404; # managed by Certbot

    }

    Now when I connect through the proxy (https://jellfyin.mydomain.com/) I can access my home page just fine and browse all the media. When I try to play some HD content, it usually plays quite fine. However, when I try to play the very same 4K content that works fine via the direct connection, it stutters and plays half a second every 60-90 seconds. In the dashboard it still "Direct playing - the source file is entirely compatible with this client and the session is receiving the file without modifications.

    However, in the docker logs I see this:
    Code:
    [13:56:03] [INF] [20] Jellyfin.Api.Helpers.MediaInfoHelper: User policy for matth. EnablePlaybackRemuxing: True EnableVideoPlaybackTranscoding: True EnableAudioPlaybackTranscoding: True

    The server itself is mostly idle and doesn't show any other activity that would have an influence.

    I tried different clients. The original Jellyfin Android app, as well as Streamyfin, the problem persists in both. The only difference I can figure out so far is nginx that seems to be the bottle-neck. The proxy also runs on the same machine as Jellyfin, has a 1Gbit/s network connection.

    I'm really at a loss and wonder if there is any tips you could provide as to what I can try to fix it.

    My Networking settings on the server should also be fine:

    [Image: Screenshot-2026-06-01-at-22-04-10-Networking.png]

    (The mydomain.com is obviously a placeholder for my real domain)


    Attached Files Thumbnail(s)
       
    Go to solution
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,454
    Threads: 11
    Joined: 2023 Jun
    Reputation: 467
    Country:United States
    #2
    2026-06-01, 07:37 PM
    Does this issue happen even when you are on the same network as the server? If so, you need to enable NAT loopback or setup custom DNS entries in your router so that your domain name resolves to your LAN IP instead of your WAN IP. What I THINK is going on is that your local connection attempts via your domain name are being routed out to the Internet and then coming directly back.

    Enabling NAT loopback or custom DNS entries would prevent this while you are on your home network.

    When you are NOT on your home network, do you have issues with stuttering with 4K content?
    Jellyfin 10.11.10 (Docker)
    Debian 13 w/Xanmod amd64v3 LTS kernel
    AMD Ryzen 5500 w/32GB DDR4
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    ZFS Storage pool
        vdev1 - 6x WD Red Pro 6TB CMR in RAIDZ1
        vdev2 - 3x WD Red Pro 18TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Matth
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Mar
    Reputation: 0
    Country:Switzerland
    #3
    2026-06-02, 02:30 AM
    Yes, NAT loopback is enabled on the router.

    I also pointed the domain jellyfin.mydomain.com directly to the proxy server on my Pihole. So the mobile phone gets that DNS from the Pihole.

    And yes, it stutters both at home when I'm on the same network, as well as when I'm on the mobile network.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,454
    Threads: 11
    Joined: 2023 Jun
    Reputation: 467
    Country:United States
    #4
    2026-06-02, 01:28 PM
    So your proxy is running on your pihole host? What model RPi?
    Jellyfin 10.11.10 (Docker)
    Debian 13 w/Xanmod amd64v3 LTS kernel
    AMD Ryzen 5500 w/32GB DDR4
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    ZFS Storage pool
        vdev1 - 6x WD Red Pro 6TB CMR in RAIDZ1
        vdev2 - 3x WD Red Pro 18TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Matth
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Mar
    Reputation: 0
    Country:Switzerland
    #5
    2026-06-02, 02:36 PM
    No, the proxy is running on the same machine as Jellyfin is running on. The Pihole is on a Raspberry Pi 5, but is a different machine.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,454
    Threads: 11
    Joined: 2023 Jun
    Reputation: 467
    Country:United States
    #6
    2026-06-02, 02:38 PM
    (2026-06-02, 02:36 PM)Matth Wrote: No, the proxy is running on the same machine as Jellyfin is running on. The Pihole is on a Raspberry Pi 5, but is a different machine.

    Can you try changing this line in your nginx config?

    From:
    Code:
        set $jellyfin 192.168.7.8;

    To:
    Code:
        set $jellyfin localhost;
    Jellyfin 10.11.10 (Docker)
    Debian 13 w/Xanmod amd64v3 LTS kernel
    AMD Ryzen 5500 w/32GB DDR4
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    ZFS Storage pool
        vdev1 - 6x WD Red Pro 6TB CMR in RAIDZ1
        vdev2 - 3x WD Red Pro 18TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Matth
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Mar
    Reputation: 0
    Country:Switzerland
    #7
    2026-06-04, 02:29 AM
    That will definitely not work. While the proxy and the Jellyfin container are on the same physical machine, the proxy is run as a Virtual Machine on VirtualBox.

    The physical server has the IP 192.168.7.8, while the proxy's IP is 192.168.7.26.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,454
    Threads: 11
    Joined: 2023 Jun
    Reputation: 467
    Country:United States
    #8
    2026-06-04, 03:57 PM
    Is the VM only running the proxy? What is the reasoning for having the proxy in a VM?
    Jellyfin 10.11.10 (Docker)
    Debian 13 w/Xanmod amd64v3 LTS kernel
    AMD Ryzen 5500 w/32GB DDR4
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    ZFS Storage pool
        vdev1 - 6x WD Red Pro 6TB CMR in RAIDZ1
        vdev2 - 3x WD Red Pro 18TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Matth
    Offline

    Junior Member

    Posts: 7
    Threads: 1
    Joined: 2025 Mar
    Reputation: 0
    Country:Switzerland
    #9
    2026-06-05, 03:01 AM
    I installed the proxy a couple of years ago and at that time it seemed to be a reasonable way to keep it separate. I'd probably prefer to run it in a docker container if I did that again.

    And yes, the VM is only running the reverse proxy and a few static web pages I use as a local dashboard. Nothing else. The proxy runs on Ubuntu 24.04.4 LTS.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,454
    Threads: 11
    Joined: 2023 Jun
    Reputation: 467
    Country:United States
    #10
    2026-06-05, 12:54 PM
    For testing, can you run a proxy either directly in the OS running Jellyfin or in a container? The only thing that makes sense is that the routing between the host and VM is wonky and traffic is taking an unnecessarily long/slow route.
    Jellyfin 10.11.10 (Docker)
    Debian 13 w/Xanmod amd64v3 LTS kernel
    AMD Ryzen 5500 w/32GB DDR4
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    ZFS Storage pool
        vdev1 - 6x WD Red Pro 6TB CMR in RAIDZ1
        vdev2 - 3x WD Red Pro 18TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Pages (2): 1 2 Next »

    « 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