Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Jellyfin behind Proxy using NPM

Featured Replies

Ok guys, It takes alot for me to come here and I am beyond irritated.  

 

I have jellyfin installed and running.  All libraries up and working locally.  

 

I have a url setup for outside access.  jellyfin.mydomain.com

When I access it via browser or the android app it loads fine, when i go to play a movie it errors out with a fatal error related to authentication it appears. 

Jellyfin.Api.Auth.CustomAuthenticationHandler: AuthenticationScheme: "CustomAuthentication" was challenged.

 

I have NPM handling everything.  I added this to advanced tab
 

    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 streaming
        proxy_buffering off;
    }

    location = /web/ {
        # Proxy main Jellyfin traffic
        proxy_pass $forward_scheme://$server:$port/web/index.html;
        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;
    }

    location /socket {
        # 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;
    }

 

I cannot for the life of me get this to work.  Can someone show me a STEP BY STEP on how to get this working?  I have been doing IT for about 20 years and am at a loss of what to do.  I am also using cloudflare for my DNS. 

 

Request URL:

https://jellyfin.MYDOMAIN.io/videos/1d2d5c5f-ddce-4b70-9fa8-ce847bada945/hls1/main/-1.mp4?DeviceId=TW96aWxsYS81LjAgKFdpbmRvd3MgTlQgMTAuMDsgV2luNjQ7IHg2NCkgQXBwbGVXZWJLaXQvNTM3LjM2IChLSFRNTCwgbGlrZSBHZWNrbykgQ2hyb21lLzEzNC4wLjAuMCBTYWZhcmkvNTM3LjM2fDE3NDI5NDQyNTkyODg1&MediaSourceId=1d2d5c5fddce4b709fa8ce847bada945&VideoCodec=av1,hevc,h264,vp9&AudioCodec=aac&AudioStreamIndex=1&SubtitleStreamIndex=2&VideoBitrate=139616000&AudioBitrate=384000&MaxFramerate=23.976025&PlaySessionId=3b25315be1084b2eb7fc74a316b216c9&api_key=30bca4e086ee4b6392fd06bdd094a361&SubtitleMethod=Encode&TranscodingMaxAudioChannels=2&RequireAvc=false&EnableAudioVbrEncoding=true&Tag=01f2e0fcbffaa2de930c7314be883972&SegmentContainer=mp4&MinSegments=1&BreakOnNonKeyFrames=True&h264-level=40&h264-videobitdepth=8&h264-profile=main&av1-profile=main&av1-rangetype=SDR,HDR10,HLG&av1-level=19&vp9-rangetype=SDR,HDR10,HLG&hevc-profile=main,main10&hevc-rangetype=SDR,HDR10,HLG&hevc-level=183&hevc-deinterlace=true&h264-rangetype=SDR&h264-deinterlace=true&TranscodeReasons=AudioCodecNotSupported,%20SubtitleCodecNotSupported&runtimeTicks=0&actualSegmentLengthTicks=0

Request Method:

GET

Status Code:

401 Unauthorized

Remote Address:

104.21.23.74:443

Referrer Policy:

no-referrer

 

Edited by davidjmorin

  • Author

oh and here is a curveball.  If i visit MYEXTERNALIP:8096 it loads and works just fine.  Its clearly something with the DNS. 

What ports did you forward on your router?  Your external port:8096 should not go through.  How did you set your ports in the NPM docker template?  Jellyfin should work fine with the advanced tab empty.  All you should need is block common exploits and force ssl.

  • Author
8 minutes ago, Gragorg said:

What ports did you forward on your router?  Your external port:8096 should not go through.  How did you set your ports in the NPM docker template?  Jellyfin should work fine with the advanced tab empty.  All you should need is block common exploits and force ssl.

I have ports 8096 forward as well as port 80 and 443.  On plex everything worked fine.  I have all kinds of items that work fine and no need to mess with advanced at all on most.  Althelia what a bit different and needed some custom info in advanced in NPM

 

Edited by davidjmorin

Do not forward port 8096.  Which NPM docker are you using?  Did you change any port settings in the docker template?  I assue you setup the cname using cloudflare.  I have found that the one from Djoss works best for me.

Edited by Gragorg

  • Author
3 minutes ago, Gragorg said:

Do not forward port 8096.  Which NPM docker are you using?  Did you change any port settings in the docker template?  I assue you setup the cname using cloudflare.  I have found that the one from Djoss works best for me.

ok so dont forward port 8096, I am using the https://hub.docker.com/r/jlesage/nginx-proxy-manager/ image. 

yes in cloudflare i have a cname setup

I assume you setup from unraid app store with default settings?

  • Author
2 minutes ago, Gragorg said:

I assume you setup from unraid app store with default settings?

Yes sir. 

image.thumb.png.9e2af241600072e7d2b3c7f82cbd2cde.png

I need the Nginx Proxy manager one. 

  • Author
4 minutes ago, Gragorg said:

I need the Nginx Proxy manager one. 

image.thumb.png.46ede8919aa3f644d199de3efce8a52e.png

  • Author

image.png.35c94112d42b6d5da5663bab732a899c.png

In the NPM template how are those ports setup?  If memory serves docker port 8080 is set as 1880 internal port and docker port 4443 is set as internal port 18443.  Is this the case for you?

  • Author
1 minute ago, Gragorg said:

In the NPM template how are those ports setup?  If memory serves docker port 8080 is set as 1880 internal port and docker port 4443 is set as internal port 18443.  Is this the case for you?

image.thumb.png.579f9dac3f11f53ecf03f4f99f613e20.png

Do not use 80 or 443 as unraid uses them.  Change 80 to 1880 and 443 to 4443.  Then in your router forward external port 80 to internal 1880 and external port 443 to 4443 and give that a try.  You only need to do TCP protocol

Edited by Gragorg

  • Author
5 minutes ago, Gragorg said:

Do not use 80 or 443 as unraid uses them.  Change 80 to 1880 and 443 to 4443.  Then in your router forward external port 80 to internal 1880 and external port 443 to 4443 and give that a try.

I do that now all my services are down

 

Are you using 80 and 443 for other dockers.  Dont change if you already moved Unraid off those ports. 

  • Author
Just now, Gragorg said:

Are you using 80 and 443 for other dockers.  Dont change if you already moved Unraid off those ports. 

Yeah the only thing using those ports is NPM.

  • Author

Im telling you i have followed every guide and tried every trick.  Nothing works.  Page loads fine.  Movies do not play.  It has to be cloudflare related.  I have no clue. 

image.thumb.png.da5bfdfc6f99b8065c4de0c42a0a2116.png

  • Author

This is day 2 of working on this for HOURS.  Nothing works.  I dont know what im missing. 

Have you tried leaving the advanced tab in NPM blank.

  • Author
Just now, Gragorg said:

Have you tried leaving the advanced tab in NPM blank.

yep.  nothing. page loads.  Nothing plays.  fatal error

 

  • Author

This is with advanced empty and with my settings. 

image.png.7ddfd23d6f9c24982ab7aa4807598118.png

  • Author

If i visit directly via my outside IP and port it plays just fine.  Local IP is fine also

Really weird.  Maybe try turning off everything in NPM except "block common exploits" and "force ssl" and restart it.  So everything runs fine local?

  • Author
2 minutes ago, Gragorg said:

Really weird.  Maybe try turning off everything in NPM except "block common exploits" and "force ssl" and restart it.  So everything runs fine local?

 

2 minutes ago, Gragorg said:

Really weird.  Maybe try turning off everything in NPM except "block common exploits" and "force ssl" and restart it.  So everything runs fine local?

yea, local it runs as it should.  Even in the android app, if i use external ip and play a video works great.   If i use my URL.  Bumpkins

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.