Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

NPM Get Real IP of Incoming https Connections #4798

Unanswered
Trembler34 asked this question in Q&A
Discussion options

Hello, I have been pulling my hair out over this. Been trying for the last few days to get NPM to pass the real IP of the incoming HTTPS connections but it continues to show the Container IP..

Enviornment is Debian 13, w Docker/portainer/NPM and the app I am mostly trying to get to pass the real IP to is SFTPGo.

SFTPGo is currently configured to enable the proxy protocol, alllowing the IP of the Proxy. However, the issue comes in when I try to use the whitelist of Allowed IPs, it doesn't function properly because SFTPGo is only seeing remote addr=172.17.0.1 no matter where I connect from externally.

Can someone please tell me how i can get NPM to pass the real IP from the Proxy Host configured inside NPM, down to the SFTPGo container so it identifies the external IP of all connecting hosts? I have tried all sorts of different things and nothing is working (including solutions from other threads in here) I wouldn't mind doing this on a global scale, so for any future projects it will always show the real IP.. But if that can't be done. I need to at least get this working for this proxy host in question.

I have added this into the Custom Config - with no difference

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

Here is what the log looks like for all incoming connections through NPM > SFTPGo

2025年10月13日T16:25:58.362 DBG sender=httpd local_addr=172.17.0.3:8080 method=GET proto=HTTP/1.1 remote_addr=172.17.0.1:44330 request_id=4e7bb1951e04/kSkM2YBUWY-000017

You can see remote_addr is the container IP..

Thank you!

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /