Remote IP using X-Forwarded-For and mod_remoteip
Hi, I am trying to get the remote IP of web accesses in the cPanel Apache logs on our cPanel with is behind an Azure application gateway. Currently the logs just show the internal IP address of the app gateway. I have tried the procedure on the page below as suggested by cPanel support:
https://support.cpanel.net/hc/en-us/articles/360051107513-How-to-restore-visitors-IP-with-mod-remoteip
and various other suggestions in other mod_remoteip howtos. I have tried various LogFormat settings such as %a instead of %h without success. Using %{X-Forwarded-For}i in the LogFormat setting I did get the remote IP and another number appended showing in the logs. I am not sure how to parse the just IP address from that value. Apparently using %{X-Forwarded-For} in the LogFormat setting is not recommended.
Has anyone got this working behind an Azure app gateway and is willing to share their config settings? Your help would be greatly appreciated.
Regards, Murray
Please sign in to leave a comment.
Comments
0 comments