[GH-ISSUE #952] Cannot get the original IP address of visitor. #803

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

Originally created by @Rhandyx on GitHub (Mar 15, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/952

First of all
I´m beginner in docker and in nginx-proxy.
I install it because I need run 2 vm´s with different web sites under same ip.

For DNS I use cloudflare:

I´m using xenserver (xcp-ng) 3 Vm´s
1st Vm is running docker and nginx proxy manager
other Vm´s runs Ubuntu server and apache.
My problem is I can´t get the original Ip address from visitors on apache server logs. I need it too work with fail2ban.
I only see cloudflare ips. Not original Ips.

Best Regards

Originally created by @Rhandyx on GitHub (Mar 15, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/952 First of all I´m beginner in docker and in nginx-proxy. I install it because I need run 2 vm´s with different web sites under same ip. For DNS I use cloudflare: I´m using xenserver (xcp-ng) 3 Vm´s 1st Vm is running docker and nginx proxy manager other Vm´s runs Ubuntu server and apache. My problem is I can´t get the original Ip address from visitors on apache server logs. I need it too work with fail2ban. I only see cloudflare ips. Not original Ips. Best Regards
kerem 2026-02-26 06:34:29 +03:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@Rhandyx commented on GitHub (Mar 16, 2021):

I fix it!
Sorry.
Fisrt I have to enable apache remoteip module.

and add this lines
RemoteIPHeader X-Forwarded-For RemoteIPInternalProxy 192.168.1.X

After I have to create on custom file
vi /data/nginx/custom/server_proxy.conf
and add this
real_ip_header CF-Connecting-IP;

<!-- gh-comment-id:800316833 --> @Rhandyx commented on GitHub (Mar 16, 2021): I fix it! Sorry. Fisrt I have to enable apache remoteip module. and add this lines `RemoteIPHeader X-Forwarded-For RemoteIPInternalProxy 192.168.1.X` After I have to create on custom file `vi /data/nginx/custom/server_proxy.conf` and add this `real_ip_header CF-Connecting-IP;`
Author
Owner

@NajibNour commented on GitHub (Jun 1, 2021):

@Rhandyx Hey could you help me out with this? I'm having trouble setting this up.

<!-- gh-comment-id:851728693 --> @NajibNour commented on GitHub (Jun 1, 2021): @Rhandyx Hey could you help me out with this? I'm having trouble setting this up.
Author
Owner

@ex3me4me commented on GitHub (Jun 14, 2021):

@Rhandyx Hey could you help me out with this? I'm having trouble setting this up.

The easy way > Open your NPM> go to hosts > proxy hosts > choose desired host. click on 3dots menu and choose edit. Go to Advanced and paste real_ip_header CF-Connecting-IP; into Custom Nginx Configarition > save
Check if it's working:)

<!-- gh-comment-id:860293541 --> @ex3me4me commented on GitHub (Jun 14, 2021): > > > @Rhandyx Hey could you help me out with this? I'm having trouble setting this up. The easy way > Open your NPM> go to hosts > proxy hosts > choose desired host. click on 3dots menu and choose edit. Go to Advanced and paste `real_ip_header CF-Connecting-IP;` into Custom Nginx Configarition > save Check if it's working:)
Author
Owner

@NajibNour commented on GitHub (Jun 14, 2021):

Hey yes I ended up getting it, npm I figured out that npm automatically pulls Cloudflare proxy ips and loads them in. All that’s needed is the real ip header In the advanced tab. Also there seems to be a bug where it only accepts the acl config after you do the following. You must have the host enabled, Create the ACL, Then set the ACL then Unset then set The ACL. That was the only way I could get it to work.

thanks for the help! Hopefully my comment helps others!

@Rhandyx Hey could you help me out with this? I'm having trouble setting this up.

The easy way > Open your NPM> go to hosts > proxy hosts > choose desired host. click on 3dots menu and choose edit. Go to Advanced and paste real_ip_header CF-Connecting-IP; into Custom Nginx Configarition > save
Check if it's working:)

<!-- gh-comment-id:860297697 --> @NajibNour commented on GitHub (Jun 14, 2021): Hey yes I ended up getting it, npm I figured out that npm automatically pulls Cloudflare proxy ips and loads them in. All that’s needed is the real ip header In the advanced tab. Also there seems to be a bug where it only accepts the acl config after you do the following. You must have the host enabled, Create the ACL, Then set the ACL then Unset then set The ACL. That was the only way I could get it to work. thanks for the help! Hopefully my comment helps others! > > @Rhandyx Hey could you help me out with this? I'm having trouble setting this up. > > The easy way > Open your NPM> go to hosts > proxy hosts > choose desired host. click on 3dots menu and choose edit. Go to Advanced and paste `real_ip_header CF-Connecting-IP;` into Custom Nginx Configarition > save > Check if it's working:)
Author
Owner

@NajibNour commented on GitHub (Jun 14, 2021):

See issue https://github.com/jc21/nginx-proxy-manager/issues/919
For more help

<!-- gh-comment-id:860297826 --> @NajibNour commented on GitHub (Jun 14, 2021): See issue https://github.com/jc21/nginx-proxy-manager/issues/919 For more help
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#803
No description provided.