Jump to content

Nginx Proxy Manager Docker


Recommended Posts

Posted

Hello, I’ve been trying for days to make Emby work with Nginx Proxy Manager. I’ve set everything up, but the only issue I think is impossible to resolve is displaying the real IP address, like it shows on localhost or when adding the domain directly to Emby without the proxy. Every time I try, it only shows the Docker IP.  I’ve tried everything, read every post on the forum, and tested every solution, but with no success. Is this even posible ?

darkassassin07
Posted (edited)

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

 

 

You need these two headers set. These are the lines directly from nginxs config; I'm not sure how you enable/set them in NPM as I don't use that.

 

 

 

You must also set this setting in Emby > Network 

 

SmartSelect_20250318_073727_Emby.jpg.3c596f38b7087522fa97c34ed4f90070.jpg

Edited by darkassassin07
  • Thanks 1
Posted
2 hours ago, darkassassin07 said:

proxy_set_header X-Real-IP $remote_addr;

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

 

 

You need these two headers set. These are the lines directly from nginxs config; I'm not sure how you enable/set them in NPM as I don't use that.

 

 

 

You must also set this setting in Emby > Network 

 

SmartSelect_20250318_073727_Emby.jpg.3c596f38b7087522fa97c34ed4f90070.jpg

I tried this already , nothing changes .. Stil showing ip from docker..

Posted

Is the docker container in host or bridge networking mode?

Posted
27 minutes ago, Luke said:

Is the docker container in host or bridge networking mode?

0.0.0.0:80-81->80-81/tcp, 0.0.0.0:443->443/tcp      in host ..

Posted

Hi, have you compared your nginx settings to this?

 

Posted (edited)
18 minutes ago, Luke said:

Hi, have you compared your nginx settings to this?

 

I tried everything from that post it will work , but it will never show real ip addres only docker ip showing allways tried from local and remote same..

Edited by dustart
Posted
6 minutes ago, dustart said:

I tried everything from that post it will work , but it will never show real ip addres only docker ip showing allways tried from local and remote same..

What exactly did you try from it?

Posted (edited)
22 minutes ago, Luke said:

What exactly did you try from it?

proxy_set_header X-Real-IP $remote_addr;  ## Passes the real client IP to the backend server.


# Add the following headers inside your server block or location block

add_header X-Frame-Options "SAMEORIGIN" always;  # Prevents clickjacking attacks
add_header X-XSS-Protection "1; mode=block" always;  # Enables XSS protection in the browser
add_header X-Content-Type-Options "nosniff" always;  # Prevents MIME type sniffing
add_header Referrer-Policy "origin-when-cross-origin" always;  # Controls what referrer info is sent


proxy_set_header Range $http_range;  ## Allows specific chunks of a file to be requested.
proxy_set_header If-Range $http_if_range;  ## Allows specific chunks of a file to be requested.
 

Tried this to add to Custom Nginx Configuration , also tried to ngnix main config file it saves and run but still not showing ip .. 

 

Also i tried this config  same stil showing only docker ip ..

 

 

 

Edited by dustart
Posted (edited)
5 hours ago, Luke said:

What exactly did you try from it?

I think problem is here because windows 10 with docker desktop can't use --network host this only works on linux .. I not tried that but from my reading it need to be only linux system , not docker on windows...

Edited by dustart
Clackdor
Posted
45 minutes ago, dustart said:

I think problem is here because windows 10 with docker desktop can't use --network host this only works on linux .. I not tried that but from my reading it need to be only linux system , not docker on windows...

Yeah that sounds like a limitation of the default WSL networking mode It's basically doing NAT.

If you were on Windows 11, it has an option change the networking mode of the WSL2 instance for docker  to "mirrored mode" I believe this is supposed to solve the problem of passing real connection IP's to docker containers set to use the host network.

Is emby installed on the same windows machine natively or in docker? Just curious.

  • Thanks 1
Posted
15 minutes ago, Clackdor said:

Yeah that sounds like a limitation of the default WSL networking mode It's basically doing NAT.

If you were on Windows 11, it has an option change the networking mode of the WSL2 instance for docker  to "mirrored mode" I believe this is supposed to solve the problem of passing real connection IP's to docker containers set to use the host network.

Is emby installed on the same windows machine natively or in docker? Just curious.

Nice, I didn't know that. I thought I had to use Linux for this. I tried both ways, and it's the same for both; it will always show the IP from Docker. I also tried creating a network in Docker, but it will always show the same IP from Docker. Then I found out that Docker on Windows 10 can't use the host network; it can only be done on Linux. So, can the mirrored mode on Windows 11 enable the host network mode inside Docker?  Also i wanna to fix this because i think this is problem for transcoding , transcoding by auto not working when i use domain trough proxy , but if i use my real domain it will work then.

Posted

Can you try our native package directly on the host machine?

Posted
19 hours ago, Luke said:

Can you try our native package directly on the host machine?

Native like out of docker emby instaler for instaling direct on windows ? 

Posted
On 3/19/2025 at 5:20 AM, Luke said:

Can you try our native package directly on the host machine?

This issue can't be resolved on Windows 10 with Docker because Docker on Windows 10 doesn't support host networking mode—it only supports bridged or custom networking. I resolved this issue by switching to Linux and installing the official Emby image along with Nginx Proxy Manager inside Docker, i didn't use any advanced or custom settings, nor did I use Docker Compose. I only used the default emby/embyserver:latest Docker image.

However, now I have a new issue. I can access the domain, and everything seems fine, including SSL. But on the Emby dashboard, it displays:

Emby Web 4.8.11.0
Firefox
my real ip  http/1.1
 
Why does it show HTTP/1.1 instead of SSL when I'm accessing it through SSL with a secure domain? Is this normal?
GrimReaper
Posted
15 minutes ago, dustart said:

However, now I have a new issue. I can access the domain, and everything seems fine, including SSL. But on the Emby dashboard, it displays:

Emby Web 4.8.11.0
Firefox
my real ip  http/1.1
 
Why does it show HTTP/1.1 instead of SSL when I'm accessing it through SSL with a secure domain? Is this normal?

Have a read here:

 

  • Thanks 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...