Get Client's Real IP (CF Headers) #7646
Unanswered
pradumnk-mahanta
asked this question in
Q&A
Replies: 1 comment 1 reply
-
You keep mentioning both AdGuard DNS and AdGuard Home, which are two different things. Assuming you actually mean AdGuard Home, you can enable verbose logging and see the decisions AGH does with regards to the incoming hosts and IP addresses. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I am not sure if I am doing anything wrong or its just not working, I thougt I will ask here before I raise an issue.
I am using AdGuardHome to do DNS Rewrites on my local Network. So any basic outside request will look like the following,
Client (
1.2.3.4
) -> Cloudflared Tunnel (192.168.1.X
) -> Adguard Home (192.168.1.A
) -> NGINX Proxy Manager (192.168.1.Y
) -> Application (192.168.1.Z
)Now following the logs, I can see Tunnel is getting the Client's IP Address in Headers,
X-Forwarded-For
Cf-Connecting-IP
X-Real-IP
All contain the same values,
1.2.3.4
This request now goes to Adguard DNS and then redirected to NGINX Proxy Manger, which in Logs recognises the Request coming from
1.2.3.4
using theX-Real-IP
. It logs the same.The Issue here is, My Adguard Home still logs the request coming from
192.168.1.X
which is the Tunnel IP.Now, the documentation, and mutiple other discussions say, I can use
trusted_proxies
of the config to get information from the HTTPS headers for the client.#3451
Configuration
So, following the above, I added, all the CF IPs IP Ranges to the
trusted_proxies
Section.But it still logs
192.168.1.X
which is the Tunnel IP.So, I added the Tunnel IP
192.168.1.X
as well to thetrusted_proxies
Section (Also tried with whole network subnet as well).But it still logs
192.168.1.X
which is the Tunnel IP.I definitely know the the values are present in the request because NGINX Proxy Manger which is after Adguard is able to log the correct IP.
I tried, Adguard in Docker, OpenWrt Directly and still got the same issue.
Adguard Version 1.107.56
Any pointers by anyone whould be much appreciated.
Beta Was this translation helpful? Give feedback.
All reactions