Jellyfin Forum
NPM + Docker and Jellyfin - 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: NPM + Docker and Jellyfin (/t-npm-docker-and-jellyfin)

Pages: 1 2


NPM + Docker and Jellyfin - AverageStewie - 2024-05-28

Hello,

I'm having some issues with IPs on my server... Jellyfin is being run behinde nginx proxy manager. It only gives me 172.17.0.1 for IPs, regardless where I connect from...

NPM and Jellyfin is both running inside a docker container.
I have a DNS server running as well (Adguardhome in docker) that I've set for my network, I'm as well redirecting jf.mydomain.no to 10.0.0.140 inside adguardhome.

I've attached som photos from jellyfin and NPM.

NPM advanced tab contains the Jellyfin nginx config from their DOC.

Anyone know what to do?


RE: NPM + Docker and Jellyfin - bitmap - 2024-05-28

I use vanilla nginx, so my config is a bit different, but if you read the note on the last screenshot you included, it says that set_header and add_header directives are ignored and must be added in a location custom config.

I would guess that's where your issue is -- your set_header directives are not part of a location block and are being ignored.


RE: NPM + Docker and Jellyfin - TheDreadPirate - 2024-05-28

Did you set a "known proxy" in Jellyfin?

(btw, I wrote the latest iteration of the Nginx Proxy Manager docs)


RE: NPM + Docker and Jellyfin - AverageStewie - 2024-05-28

(2024-05-28, 12:31 PM)bitmap Wrote: I use vanilla nginx, so my config is a bit different, but if you read the note on the last screenshot you included, it says that set_header and add_header directives are ignored and must be added in a location custom config.

I would guess that's where your issue is -- your set_header directives are not part of a location block and are being ignored.

Yea I did notice that... But the in the docs it says to put it there... So I'm not sure ( https://jellyfin.org/docs/general/networking/nginx#nginx-proxy-manager )

I tried to create custom location and so on.. But then it stops working all togehter.....

(2024-05-28, 12:58 PM)TheDreadPirate Wrote: Did you set a "known proxy" in Jellyfin?

(btw, I wrote the latest iteration of the Nginx Proxy Manager docs)

Yes, I put the IP for it in there( 10.0.0.140 ). Because the NPM and DNS is also running on the same host as jellyfin.


RE: NPM + Docker and Jellyfin - TheDreadPirate - 2024-05-28

Is 172.17.0.1 the IP of the Nginx container? If so, that should be IP for the known proxy.


RE: NPM + Docker and Jellyfin - AverageStewie - 2024-05-28

(2024-05-28, 01:26 PM)TheDreadPirate Wrote: Is 172.17.0.1 the IP of the Nginx container?  If so, that should be IP for the known proxy.

Npm has: 172.18.0.2.

I think 172.17.0.1 is the gateway? Or am I wrong.


RE: NPM + Docker and Jellyfin - TheDreadPirate - 2024-05-28

Try either of those. Pretty sure it should be Nginx's IP, 172.18.0.2.


RE: NPM + Docker and Jellyfin - MisterMcDuck - 2024-05-28

FWIW your custom config looks a bit different than mine, maybe compare?

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 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;
    }



RE: NPM + Docker and Jellyfin - AverageStewie - 2024-05-28

(2024-05-28, 01:58 PM)TheDreadPirate Wrote: Try either of those.  Pretty sure it should be Nginx's IP, 172.18.0.2.

I tried putting it as know proxy, didn't do anything.
I restarted afterwards. hmmm

(2024-05-28, 03:10 PM)MisterMcDuck Wrote: FWIW your custom config looks a bit different than mine, maybe compare?

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 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;
    }

But is this for Nginx Proxy Manager or just nginx?


RE: NPM + Docker and Jellyfin - bitmap - 2024-05-29

That looks similar (not identical) to my nginx conf file for Jellyfin, so wouldn't be entirely applicable to NPM. However, if you're able to edit the conf file within NPM, something like that should work. Doesn't NPM just create the conf file for you anywho?