Replies: 12 comments 11 replies
-
Did you make any progress on the issue? Currently having the same problem, and the fix in this issue does nothing for me. |
Beta Was this translation helpful? Give feedback.
-
In my case, the issue was caused by trying to get X-Forwarded-For when it was not HTTPS. |
Beta Was this translation helpful? Give feedback.
-
Anyone got a fix for this? |
Beta Was this translation helpful? Give feedback.
-
My question is relevant to the topic, so I'm posting it here. How can I forward the source IP for a TCP stream? Currently only the Docker Host IP is displayed on the upstream server, so i can´t use Autoblock-IP by failed logins. Thank you very much. |
Beta Was this translation helpful? Give feedback.
-
Synology workaround fix for this! I found a solution for this if you are trying to run NPM (Docker) on a Synology. It seems that there are some pre-routing rules that need to be added to the Synology host for the IP addresses to report the client and not Docker. I found this post with the solution:
The short of it is you need to apply the following iptable rules on Synology (cli): Only catch is that these changes will not sustain post reboot. In order for that to happen you need to create a boot-up task in the task scheduler and add the script he created so that the rule changes are applied every startup. I tested the rule changes and it seems I can now properly use the Access List and restrict access to local (LAN) only.
|
Beta Was this translation helpful? Give feedback.
-
Hi @Waldorf3!
I had the same problem. I hope it can be useful. 👍 |
Beta Was this translation helpful? Give feedback.
-
Someone has been able to fix this? I am on Ubuntu Server |
Beta Was this translation helpful? Give feedback.
-
probably the most useless post here |
Beta Was this translation helpful? Give feedback.
-
Yes, the problem was at my router settings level; I had forgotten that I had set up the following: Allow LAN traffic without NAT (Keep original source IP)iptables -t nat -A POSTROUTING -p tcp -d 192.168.0.0/16 -j RETURN Keep real client IPs for HTTPS trafficiptables -t nat -A POSTROUTING -p tcp -d <synology_ip> --dport 443 -j RETURN Masquerade everything else (for outbound internet traffic)iptables -t nat -A POSTROUTING -j MASQUERADE |
Beta Was this translation helpful? Give feedback.
-
Fixed it with this: Now login to your Nextcloud server commandline via SSH |
Beta Was this translation helpful? Give feedback.
-
I found a solution for me with NPM and Nextcloud. Reverse Proxy says "Nextcloud uses the de-facto standard header ‘X-Forwarded-For’ by default", so setting the 'forwarded_for_headers' isn't needed. Under ...data/nginx/proxy_host NPM stores the configuration for the Hosts you configure in the webinterface and i noticed following in the ___location section in my "13.conf" for Nextcloud (for you it might be a different number).
There is already a include for a folder conf.d and a proxy.conf, which isn't created yet!
Since all standard conf for the proxy hosts are similar this should work for every other hosts, but i haven't confirmed yet. Then i just had to add the trusted_proxies to the ".../www/nextcloud/config/config.php". I wanted to add Fail2Ban to nextcloud but i noticed that it already as a own "Brute-Force" module, which limits attempts for an IP. Setting the network_mode to host in the docker-compose.yaml wasn't needed for me. |
Beta Was this translation helpful? Give feedback.
-
I've tried this exactly solution and restarted NPM, made the folder, made
the proxy.conf file, etc, I can see it's called during NPM reboot in the
logs, still nothing. There isn't a place in Bitwarden (where I'm currently
trying to get the real IP) to specify trusted proxies, only trusted IPs,
which I've done. Still grabs the Container IP.
…On Tue, Jul 22, 2025 at 5:02 PM DerGeraet69 ***@***.***> wrote:
I found a solution for me with NPM and Nextcloud.
Reverse Proxy
<https://docs.nextcloud.com/server/31/admin_manual/configuration_server/reverse_proxy_configuration.html>
says "Nextcloud uses the de-facto standard header ‘X-Forwarded-For’ by
default", so setting the 'forwarded_for_headers' isn't needed.
Under ...data/nginx/proxy_host NPM stores the configuration for the Hosts
you configure in the webinterface and i noticed following in the ___location
section in my "13.conf" for Nextcloud (for you it might be a different
number).
___location / {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $http_connection;
proxy_http_version 1.1;
# Proxy!
include conf.d/include/proxy.conf;
}
There is already a include for a folder conf.d and a proxy.conf, which
isn't created yet!
I added "...data/nginx/proxy_host/conf.d/proxy.conf" with following
content:
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Since all standard conf for the proxy hosts are similar this should work
for every other hosts, but i haven't confirmed yet.
Then i just had to add the trusted_proxies to the
".../www/nextcloud/config/config.php".
Maybe a restart of the Proxy is needed, but after that i got the real IP
in the nextcloud.log for failed logins.
I wanted to add Fail2Ban to nextcloud but i noticed that it already as a
own "Brute-Force" module, which limits attempts for an IP.
Setting the network_mode to host in the docker-compose.yaml wasn't needed
for me.
—
Reply to this email directly, view it on GitHub
<#3215 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AF7DQAKZRXJPTSG53JQOBOL3J2RHXAVCNFSM6AAAAAA5G26J52VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTGOBVGUYDOMA>
.
You are receiving this because you are subscribed to this thread.Message
ID:
<NginxProxyManager/nginx-proxy-manager/repo-discussions/3215/comments/13855070
@github.com>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
So my setup is as follows.
I have a Proxmox server with a number of virtual machines.
All virtual macines are interconnected with private IP addresses (like 10.10.10.x, with x essentially being the VMID)
One virtual machine additionally has a public ip address. It runs nginx-proxy-manager in docker, and receives the traffic on the public IP address, and forwards the traffice to the other virtual machines through the private IP addresses.
This works perfectly except the virtual machines all see the traffic (the IP) as coming from the nginx-proxy-manager.
I've spent hours now trying to get the real client IP address to appear in the access log files on the proxy clients, but nothing works.
So I tried leaving the customer nginx configuration (in the gui) empty, and I have tried adding the lines
With IP being both the public IP address and the private IP address. I tried other combinations I found here and elsewhere, but the bottom line is, nothing ever changes.
On the clients I also tried adding
Again with IP being both the private and the public IP on the nginx-proxy-server, but nothing changes anything.
Surely there must be one correct way to set this up? Is this documented somewhere? I haven't been able to find any, other than man discussions here, and that isn't always clear and usually different situations.
Beta Was this translation helpful? Give feedback.
All reactions