Apache server behind a proxy server
If you are using an apache server behind a proxy server, you may find that in your log files you will be given the proxy IP as the source IP of the connection. This is true,
however you can adjust the apache log settings to pass the X-Forwarded-For IP onto the apache log files.
My original log settings looked like this (httpd.conf)
1 LogFormat “%h %l %u %t \”%r\” %>s %b \”%{Referer}i\” ” combined
The apache log settings dictate that %h is the source IP, in my instance it was my Proxy server. By changing my apache log format to
1 LogFormat “%{X-Forwarded-For}i %l %u %t \”%r\” %>s %b \”%{Referer}i\” \”%{User-Agent}i\” %h” sitename
and then telling the site config to use the ‘sitename’ settings
view source
print?
1 CustomLog logs/rmohan-access_log sitename
Recent Comments