nginx-proxy-manager icon indicating copy to clipboard operation
nginx-proxy-manager copied to clipboard

Forwarding real remote IP to proxied server with Nginx

Open isms-core-project opened this issue 3 years ago • 7 comments

Hi,

We are using you awesome solution in production environments without any issues. TY for this excellent Nginx Reverse Proxy. But with MFA being the normal security standard we need to be able at application level to perform an IP address filtering to require MFA when users connect from outside the trusted networks and locations.

We bypassed the issue by adding manually

proxy_set_header X-Real-IP $remote_addr;

but obviously after a container update we need to perform the task again.

Could it be possible to add the Nginx Directive as default in your container? TY in advance. BR Greg

isms-core-project avatar Aug 06 '23 08:08 isms-core-project

你好,请问这个命令如何使用,添加到高级里么

xwndo avatar Aug 09 '23 09:08 xwndo

I have the problem to get real IP. my setup like this network flows: Internet > router > server 1 > server 2 Server 1: Nginx Proxy Manager only ## this is a only proxy server Server 2: Nginx proxied sites

I noticed when both server 1 and server 2 are using nginx, the website in server 2 could not get the visitor real IP this maybe cause by this routing have too much header layers, header1 and header 2, anyone have solve this problem?

weasam avatar Aug 09 '23 20:08 weasam

We bypassed the issue by adding manually

proxy_set_header X-Real-IP $remote_addr;

but obviously after a container update we need to perform the task again.

If you manually edit the prox conf while nginx is not running and then start nginx, it sticks forever unless you do the same step in reverse or delete it.

If you want a permanent GUI solution, it already exists. Screenshot_2023-08-12-20-10-43-919_com android chrome-edit

Mainfrezzer avatar Aug 12 '23 18:08 Mainfrezzer

hey can u post me the code here ?

jacksonm36 avatar Aug 22 '23 11:08 jacksonm36

set_real_ip_from  1234:5678:9101:abcd:efgh:ijkl:mnop:qrst;
set_real_ip_from  XXX.XX.XX.XX;
real_ip_header X-Forwarded-For;

the set_real_ip_from are the ips from my 1st reverse proxy. this is the code in the second reverse proxy.

As stated before, editing the config file while the container isnt running should result in the same permanent change.

Mainfrezzer avatar Sep 04 '23 12:09 Mainfrezzer

Issue is now considered stale. If you want to keep it open, please comment :+1:

github-actions[bot] avatar Apr 08 '24 01:04 github-actions[bot]

Issue was closed due to inactivity.

github-actions[bot] avatar Jun 06 '25 02:06 github-actions[bot]