mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #41] Setting Real IP is not working... #37
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#37
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @SaulGoodman1337 on GitHub (Jan 4, 2019).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/41
somehow the whole thing doesn't work out for me. The IP address of the reverse proxy always arrives at the remote hosts.
But I don't understand why.
Does anyone have the same problem?
@jc21 commented on GitHub (Jan 7, 2019):
Can you provide some more info for me:
@SaulGoodman1337 commented on GitHub (Jan 7, 2019):
Hi,
v2.0.8
10.20.29.1 - baremetal Host (Native)
172.30.0.3 - nginx proxy manager (Docker)
192.168.0.3 - Plex (Docker)
The ip of the nginx proxy manager (172.30.0.3)
i hope that's enough information for you. if you need more, ask me.
@jc21 commented on GitHub (Jan 9, 2019):
So on the upstream host, what http header are you using to identify the "real" ip? Take a look at the http headers received by an upstream host on my test host.
The
SERVER_ADDRis the NPM docker container, which is correct, but theHTTP_X_FORWARDED_FORheader is the real IP of the client, you. All web services that need to identify a real client IP should be respecting the forwarded for header too, as it's used by virtually all proxying software and CDNs.The Nginx logs output the correct client IP also, as there is options in there to skip using the docker ranges.
@nicotontige commented on GitHub (Feb 16, 2019):
sry for the late response, but in a swarm cluster the
HTTP_X_FORWARDED_FORis never the good one.There is a tip found here :
https://github.com/moby/moby/issues/25526#issuecomment-463668116
The solution :
It works for me, i've got the real ip on my nginx backend with HTTP_X_FORWARDED_FOR
On my nginx backend configuration file :
Hope it will help
@marrobHD commented on GitHub (Jul 5, 2020):
Maybe I'm doing something wrong but the guest still only shows the local ip of npm
@chaptergy commented on GitHub (Oct 25, 2021):
There is nothing we can do about that. In normal network mode docker overwrites the ip with the gateway ip when being accessed from the same machine the docker stack is hosted on.
The only thing you can do is to switch to host mode for the docker ports as described in the post above.
@natechoiniere commented on GitHub (Sep 5, 2023):
Just to be clear, this means that it's impossible for NPM to discern who's connecting to the webserver, and that it's impossible to use the Access List in order to make some pages internal-only out of the box. This is intended behavior? I'm coming from https://github.com/NginxProxyManager/nginx-proxy-manager/issues/674