[GH-ISSUE #2096] logs internal ip instead of external #1510

Closed
opened 2026-02-26 07:31:21 +03:00 by kerem · 2 comments
Owner

Originally created by @okuzlu on GitHub (Jun 6, 2022).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2096

internal ip address of the nginx-proxy-manager (172.19.x.x) is shown in the access logs of my applications (example bookstack).
how can I get the real ip address instead of the internal?

If I look at the nginx-proxy-manager logs at /logs/proxy-host-x.access.log the external ip is there but not in the container of the application.

i have this running behind cloudflare proxy and set x-forwarded header

Originally created by @okuzlu on GitHub (Jun 6, 2022). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/2096 internal ip address of the nginx-proxy-manager (172.19.x.x) is shown in the access logs of my applications (example bookstack). how can I get the real ip address instead of the internal? If I look at the nginx-proxy-manager logs at /logs/proxy-host-x.access.log the external ip is there but not in the container of the application. i have this running behind cloudflare proxy and set x-forwarded header
kerem 2026-02-26 07:31:21 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@the1ts commented on GitHub (Jun 7, 2022):

This is because NPM is doing the usual for http servers in this situation, i.e. using the ngx_http_real_ip module and setting real_ip for private IP space IPs and CDNs. This swaps in x-forwarded-for header IPs into the log files. Your applications are not doing this so log the address hitting them i.e. outbound IP of the NPM container.
Take a look at /etc/nginx/nginx.conf inside the container for the real_ip section.

<!-- gh-comment-id:1148336916 --> @the1ts commented on GitHub (Jun 7, 2022): This is because NPM is doing the usual for http servers in this situation, i.e. using the ngx_http_real_ip module and setting real_ip for private IP space IPs and CDNs. This swaps in x-forwarded-for header IPs into the log files. Your applications are not doing this so log the address hitting them i.e. outbound IP of the NPM container. Take a look at /etc/nginx/nginx.conf inside the container for the real_ip section.
Author
Owner

@okuzlu commented on GitHub (Jun 9, 2022):

This is because NPM is doing the usual for http servers in this situation, i.e. using the ngx_http_real_ip module and setting real_ip for private IP space IPs and CDNs. This swaps in x-forwarded-for header IPs into the log files. Your applications are not doing this so log the address hitting them i.e. outbound IP of the NPM container. Take a look at /etc/nginx/nginx.conf inside the container for the real_ip section.

thanks I got it working now. edited nginx.conf in the container

<!-- gh-comment-id:1151066441 --> @okuzlu commented on GitHub (Jun 9, 2022): > This is because NPM is doing the usual for http servers in this situation, i.e. using the ngx_http_real_ip module and setting real_ip for private IP space IPs and CDNs. This swaps in x-forwarded-for header IPs into the log files. Your applications are not doing this so log the address hitting them i.e. outbound IP of the NPM container. Take a look at /etc/nginx/nginx.conf inside the container for the real_ip section. thanks I got it working now. edited nginx.conf in the container
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#1510
No description provided.