[GH-ISSUE #900] Client Real IP set to NPM IP in back end Apps. #761

Closed
opened 2026-02-26 06:34:18 +03:00 by kerem · 3 comments
Owner

Originally created by @mezoology on GitHub (Feb 17, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/900

Hello, I'm using the latest (v2.8) NPM but still having the real IP logged as the proxy IP in default.log and the proxy_host-(1-6).log and of course at the backend App.
I tried some of ideas like this and this but no luck.

I'm using IPv6 only VPS if that helps

here are some logs from default.log

[16/Feb/2021:08:02:32 +0000] 444 - GET https wp.mydomain.com "/favicon.ico" [Client fd00::1:0:0:1] [Length 0] [Gzip -] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36" "http://wp.mydomain.com/"
[17/Feb/2021:09:54:41 +0000] 200 - GET http [2a0d:ipv6:1:52:1800::ea] "/" [Client fd00::1:0:0:1] [Length 568] [Gzip 1.86] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0" "-"

here are some logs from proxy_host-(1).log

[17/Feb/2021:12:26:20 +0000] - 200 200 - GET https dkr.mydomain.com "/api/templates" [Client fd00::1:0:0:1] [Length 25802] [Gzip -] [Sent-to [fd00::1:0:0:1]] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0" "https://dkr.mydomain.com/"
[17/Feb/2021:12:26:22 +0000] - 200 200 - GET https dkr.mydomain.com "/api/endpoints/1/docker/containers/json?all=1" [Client fd00::1:0:0:1] [Length 17177] [Gzip -] [Sent-to [fd00::1:0:0:1]] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0" "https://dkr.mydomain.com/"

the [fd00::1:0:0:1] is my private IPv6 gateway of the network attached to NPM and the other containers (backend apps)

how to solve this my tricks bag is empty right now.
thanks in advance.

Originally created by @mezoology on GitHub (Feb 17, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/900 Hello, I'm using the latest (v2.8) NPM but still having the real IP logged as the proxy IP in `default.log` and the `proxy_host-(1-6).log` and of course at the backend App. I tried some of ideas like [this](https://github.com/jc21/nginx-proxy-manager/issues/112) and [this ](https://github.com/jc21/nginx-proxy-manager/issues/41) but no luck. I'm using IPv6 only VPS if that helps here are some logs from `default.log` ``` [16/Feb/2021:08:02:32 +0000] 444 - GET https wp.mydomain.com "/favicon.ico" [Client fd00::1:0:0:1] [Length 0] [Gzip -] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.150 Safari/537.36" "http://wp.mydomain.com/" [17/Feb/2021:09:54:41 +0000] 200 - GET http [2a0d:ipv6:1:52:1800::ea] "/" [Client fd00::1:0:0:1] [Length 568] [Gzip 1.86] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0" "-" ``` here are some logs from `proxy_host-(1).log` ``` [17/Feb/2021:12:26:20 +0000] - 200 200 - GET https dkr.mydomain.com "/api/templates" [Client fd00::1:0:0:1] [Length 25802] [Gzip -] [Sent-to [fd00::1:0:0:1]] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0" "https://dkr.mydomain.com/" [17/Feb/2021:12:26:22 +0000] - 200 200 - GET https dkr.mydomain.com "/api/endpoints/1/docker/containers/json?all=1" [Client fd00::1:0:0:1] [Length 17177] [Gzip -] [Sent-to [fd00::1:0:0:1]] "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:85.0) Gecko/20100101 Firefox/85.0" "https://dkr.mydomain.com/" ``` the `[fd00::1:0:0:1]` is my private IPv6 gateway of the network attached to NPM and the other containers (backend apps) how to solve this my tricks bag is empty right now. thanks in advance.
kerem closed this issue 2026-02-26 06:34:18 +03:00
Author
Owner

@chaptergy commented on GitHub (May 12, 2021):

Have a look at https://github.com/jc21/nginx-proxy-manager/issues/41, if this is related

<!-- gh-comment-id:840154939 --> @chaptergy commented on GitHub (May 12, 2021): Have a look at https://github.com/jc21/nginx-proxy-manager/issues/41, if this is related
Author
Owner

@Nate-09 commented on GitHub (Jul 26, 2021):

I'm also experiencing the same issue,

I'm running a remotely.one server behind NPM and the IP of remotely clients are showing NPM Docker IP as the public IP of each client.

I've added the following to advance config in NPM to try and get things working as expected however, no luck.

add_header Content-Security-Policy "upgrade-insecure-requests";
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block" always;
add_header X-Content-Type-Options "nosniff" always;
add_header Referrer-Policy no-referrer always;
add_header X-Robots-Tag none;
proxy_hide_header Upgrade;
proxy_hide_header X-Powered-By;
proxy_set_header   Upgrade $http_upgrade;
proxy_set_header   Connection keep-alive;
proxy_set_header   Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header   X-Forwarded-Proto $scheme;

I've also tried without X-Real-IP $remote_addr and just keeping the X-Forwarded-For $proxy_add_x_forwarded_for.

I know I've doubled up abit on some of the proxy_set_header but remotely's own nginx example is the following so for testing I've tried adding things here and there but none of this is working:

server {
    listen        80;
    server_name   example.com *.example.com;
    location / {
        proxy_pass         http://localhost:5000;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection keep-alive;
        proxy_set_header   Host $host;
        proxy_cache_bypass $http_upgrade;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
    }
    location /_blazor {    
        proxy_pass http://localhost:5000;    
        proxy_http_version 1.1;    
        proxy_set_header Upgrade $http_upgrade;    
        proxy_set_header Connection "upgrade";    
        proxy_set_header Host $host;    
        proxy_cache_bypass $http_upgrade;    
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;    
        proxy_set_header   X-Forwarded-Proto $scheme;    
    }    
    location /AgentHub {    
        proxy_pass http://localhost:5000;    
        proxy_http_version 1.1;    
        proxy_set_header Upgrade $http_upgrade;    
        proxy_set_header Connection "upgrade";    
        proxy_set_header Host $host;    
        proxy_cache_bypass $http_upgrade;    
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;    
        proxy_set_header   X-Forwarded-Proto $scheme;    
    }    
    location /ViewerHub {    
        proxy_pass http://localhost:5000;    
        proxy_http_version 1.1;    
        proxy_set_header Upgrade $http_upgrade;    
        proxy_set_header Connection "upgrade";    
        proxy_set_header Host $host;    
        proxy_cache_bypass $http_upgrade;    
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;    
        proxy_set_header   X-Forwarded-Proto $scheme;    
    }    
    location /CasterHub {    
        proxy_pass http://localhost:5000;    
        proxy_http_version 1.1;    
        proxy_set_header Upgrade $http_upgrade;    
        proxy_set_header Connection "upgrade";    
        proxy_set_header Host $host;    
        proxy_cache_bypass $http_upgrade;    
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;    
        proxy_set_header   X-Forwarded-Proto $scheme;    
    }
}

Any help would be appreciated, as I'm running the latest docker build of NPM and Remotely.

<!-- gh-comment-id:886292266 --> @Nate-09 commented on GitHub (Jul 26, 2021): I'm also experiencing the same issue, I'm running a remotely.one server behind NPM and the IP of remotely clients are showing NPM Docker IP as the public IP of each client. I've added the following to advance config in NPM to try and get things working as expected however, no luck. ```nginx add_header Content-Security-Policy "upgrade-insecure-requests"; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block" always; add_header X-Content-Type-Options "nosniff" always; add_header Referrer-Policy no-referrer always; add_header X-Robots-Tag none; proxy_hide_header Upgrade; proxy_hide_header X-Powered-By; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; ``` I've also tried without X-Real-IP $remote_addr and just keeping the X-Forwarded-For $proxy_add_x_forwarded_for. I know I've doubled up abit on some of the proxy_set_header but remotely's own nginx example is the following so for testing I've tried adding things here and there but none of this is working: ```nginx server { listen 80; server_name example.com *.example.com; location / { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /_blazor { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /AgentHub { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /ViewerHub { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location /CasterHub { proxy_pass http://localhost:5000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } } ``` Any help would be appreciated, as I'm running the latest docker build of NPM and Remotely.
Author
Owner

@chaptergy commented on GitHub (Oct 25, 2021):

Closing as duplicate of https://github.com/jc21/nginx-proxy-manager/issues/41

<!-- gh-comment-id:950927375 --> @chaptergy commented on GitHub (Oct 25, 2021): Closing as duplicate of https://github.com/jc21/nginx-proxy-manager/issues/41
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#761
No description provided.