• 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 Jellyfin reverse proxy with NPM 502 Bad Gateway

     
    • 0 Vote(s) - 0 Average

    Jellyfin reverse proxy with NPM 502 Bad Gateway

    Troubleshooting unstable reverse proxy connections
    powergrim1234
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Feb
    Reputation: 0
    #1
    2024-02-25, 10:47 PM (This post was last modified: 2024-02-25, 10:58 PM by powergrim1234. Edited 4 times in total.)
    I am having a problem that I just cannot wrap my head around.

    I used to have a set-up of a Jellyfin server with some companion apps bare-metal on a fairly heavyweight and power-hungry server. I have switched that over to a more energy-efficient solution.

    The former solution was exposed to the internet via NGinx Proxy Manager(NPM). This was working just fine. No additional configuration was set via de advanced tab in NPM.

    But now that I have switched over to my newer machine things start working worse. I expose it through the same configuration as my former jellyfin server and it works for about 30 seconds. After that I get 502 Bad Gateway errors for about 5 tot 10 minutes and after that the next attempt works fine for about 30 seconds.

    What I have tried sofar:

    - Run with advanced configuration, several even. One from the officials docs, one from Reddit. All in all, no change in behaviour.
    - Spun up a container instead of bare-metal. The result is the same
    - Tried different setups regaring websocket support, no change at all
    - Compared absolutely everything with my old server. I can't see anything different, and yet that machine is working fine (still is, haven't wiped it as of yet)

    I am really lost as to how to fix this, I have read up how to spin up Traefik. But honestly, it just doesn't fit my usecase and I like the ease of NPM.

    Couple of facts:

    - DNS externally is Cloudflare. It is a full DNS passthrough
    - Firewall has not been touched, it points to the reverse proxy
    - Internal and external DNS names are fully different. So no weird internal lookups.
    - Allow remote connections is enabled
    - The proxy is listed in the networking tab of Jellyfin. Allthough I don't know if it will work. I put my dockerhost IP in there, would that be the issue?
    - NPM is fully IP-based, and HTTPS enabled and forced for external connections
    - NPM listens on 443, and is configured to redirect to port 8096.

    Does anyone have the slightest idea what logfile would help me out of where to look to resolve this?
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2024-02-26, 01:18 AM
    What are the specs of the new server? What OS?

    Can you share your jellyfin logs with us and docker compose files for nginx proxy manager and jellyfin.

    Post the above to sourcebin or pastebin and link back here.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    powergrim1234
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Feb
    Reputation: 0
    #3
    2024-02-26, 07:07 AM (This post was last modified: 2024-02-26, 07:14 AM by powergrim1234. Edited 3 times in total.)
    The new server is a low-powered machine with an Intel I3 8130u, 16GB ram, internal SSD, External HDD. It runs Ubuntu 22.04.4 LTS (uname -a result is: #21~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Fri Feb  9 13:32:52 UTC 2 x86_64 x86_64 x86_64).

    https://pastebin.com/DqpedRMQ Jellyfin Log
    https://pastebin.com/mWjDFV6J NPM Log

    https://pastebin.com/wQrPh62j NPM Docker Compose

    This is the log and compose. I`ve reverted my install back tot bare-metal after container didn't work either. So no compose file for Jellyfin.

    Something I didn't mention earlier. But if the 502's are generated, it's only there for the reverse proxy connection. The internal webserver of Jellyfin just keeps running fine. Internally I have no issue to run this whatsoever.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #4
    2024-02-26, 05:59 PM
    I'm assuming Jellyfin is using host networking. You have two options, I think. Switch nginx to host networking (you'd have to remove the ports since they're no longer needed) or put Jellyfin on the same bridge.

    Putting nginx on host networking is the easiest and what I did for my test setup.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    powergrim1234
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Feb
    Reputation: 0
    #5
    2024-02-26, 09:33 PM (This post was last modified: 2024-02-26, 09:52 PM by powergrim1234. Edited 1 time in total.)
    I`ll spin up another Jellyfin container and see what happens. Just to note, the dockerhost of Jellyfin and NPM are different.
    powergrim1234
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Feb
    Reputation: 0
    #6
    2024-02-26, 10:33 PM (This post was last modified: 2024-02-26, 10:33 PM by powergrim1234.)
    That seems to be the trick. I`ve changed the NPM netwerk_mode to host and everything seems to be working fine now. Even with a bare-metal install of Jellyfin.

    Any reason why it has to be like this? Every other application proxied by NPM works fine, only Jellyfin had issues.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,375
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #7
    2024-02-26, 10:54 PM
    Are your other apps also in docker with bridge networking?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    powergrim1234
    Offline

    Junior Member

    Posts: 5
    Threads: 1
    Joined: 2024 Feb
    Reputation: 0
    #8
    2024-02-27, 11:09 AM
    Yea those apps are hosted on a non-default bridgenetwork. All put in the same network as nginx proxy manager was. Some apps are hosted outside of that network, and they were working fine as well.

    Now my situation is as follows. Some apps hosted on dockerhost1 in their non-default but shared bridge-network. NPM hosted on dockerhost1 on a host-network. Jellyfin installed on a seperate machine as a bare-metal application. And dockerhost2 hosts some services that are exposed through NPM on dockerhost1.
    « 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