Jellyfin Forum
IP forwarding with Nginx Proxy Manager (NPM) - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Off Topic (https://forum.jellyfin.org/f-off-topic)
+--- Forum: Self-hosting & Homelabs (https://forum.jellyfin.org/f-self-hosting-homelabs)
+--- Thread: IP forwarding with Nginx Proxy Manager (NPM) (/t-ip-forwarding-with-nginx-proxy-manager-npm)

Pages: 1 2 3


IP forwarding with Nginx Proxy Manager (NPM) - Ploutos - 2025-02-13

Hello, I'm seeking some help! <3

I don’t understand how to properly set up Jellyfin and Nginx Proxy Manager so that I don’t always see the same IP (the one from the proxy or the IPv4 IPAM gateway of the NPM container network) in Jellyfin’s logs.

My DynDNS and Reverse Proxy are working fine (I've been using Jellyfin this way for a week already).

Jellyfin is running in a container with the option network_mode: "host"
NPM is running in a container with its own Docker network
I don’t understand the documentation (https://jellyfin.org/docs/general/networking/nginx), and ChatGPT suggested adding the following lines to the Custom Nginx Configuration of my Jellyfin Reverse Proxy:


proxy_set_header X-Real-IP $remote_addr; 
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 
proxy_set_header Host $host;

I also added the IP address of NPM and the IPv4 IPAM gateway of the NPM container network to the known proxies list in Jellyfin, but it still shows the same IP address for all my clients. (I restarted Jellyfin and NPM after making these changes.)

When I access Jellyfin directly without using the reverse proxy locally, the IP address shown is the local IP of my computer, so I assume the issue comes from NPM.

If anyone has an idea, please help! This isn’t a big issue right now, but I’m a bit concerned about not knowing who is actually on my network!

Thanks!


RE: IP forwarding with Nginx Proxy Manager (NPM) - Ploutos - 2025-02-13

I think I need some more knowledge about docker network. Somewhere there is a NAT that change the IP adresse of the request I need to know who is it.
I'm guessing the IPv4 IPAM gateway because the reverse proxy should forward everything no ?

The driver of the npm network is bridge (but it is not the network named bridge)


RE: IP forwarding with Nginx Proxy Manager (NPM) - TheDreadPirate - 2025-02-13

Is the Jellyfin container using port publishing or "expose"? And what IP is showing in the activity logs?


RE: IP forwarding with Nginx Proxy Manager (NPM) - Ploutos - 2025-02-13

Hi,
Here is the docker compose of my Jellyfin (https://privatebin.net/?0ac52d876f18bd86#B8HEQgoMJrVQ2oBiqTDyF2kYmgtkFpP2J9W8L13Gw269) at the end u can read
network_mode: "host"

The logs show "Emby.Server.Implementations.HttpServer.WebSocketManager: WS "172.30.0.1" request" this IP (172.30.0.1)


RE: IP forwarding with Nginx Proxy Manager (NPM) - Ploutos - 2025-02-13

Here is the docker compose of NPM if it can help (https://privatebin.net/?76822e25a83fc1c3#2Sx5viqceyFYZbwq1d4vqFPHESxSbypWP2hJAN3fVfhi)
I just created the network by using this command: docker network create npm_network


Thanks <3


RE: IP forwarding with Nginx Proxy Manager (NPM) - Ploutos - 2025-02-13

Maybe I can give you some more information about the network if necessary as for now I just know he is using the brisdge driver


RE: IP forwarding with Nginx Proxy Manager (NPM) - TheDreadPirate - 2025-02-13

Is 172.30.0.1 in the list of known proxies? That looks like the IP for the bridge network gateway. In my setup, the only IP I have in my known proxies is the bridge gateway IP. And that is sufficient to get the client IPs to log correctly after going through Nginx on the host.


RE: IP forwarding with Nginx Proxy Manager (NPM) - Ploutos - 2025-02-13

Yes 172.30.0.1 is in the list of known proxies of Jellyfin. But what do I have to add to the Nginx Advanced configuration ?
I don’t understand on the wiki


RE: IP forwarding with Nginx Proxy Manager (NPM) - TheDreadPirate - 2025-02-13

For Nginx Proxy Manager, you shouldn't need to add anything. I believe the default config is to use x-forwarded-for headers. Can you show me a screenshot if what you currently have in the known proxies field?


RE: IP forwarding with Nginx Proxy Manager (NPM) - Ploutos - 2025-02-13

Here the picture of my network configuration of Jellyfin (https://litter.catbox.moe/jv32p3.png)
Here the picture of my docker network on portainer (https://litter.catbox.moe/u2xjl5.png)
Here the picture of my reverse proxy configuration on Nginx Proxy Manager (https://litter.catbox.moe/in2yxf.png)

I also tried before by just putting the IP adresse of the gateaway of the docker network in the known proxies list in Jellyfin.