PageKite is a reverse proxy server, which means when it forwards connections to Apache, the default Apache logs will by default only ever record 127.0.0.1 as the client.
However, PageKite does attempt to add the X-Forwarded-For
HTTP header to requests whenever possible. Apache can be configured to record that value in the log-files instead of 127.0.0.1.
To enable this, add a stanza similar to the following to your site configuration:
LogFormat "%{X-Forwarded-For}i %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" f5_forwarder
SetEnvIf X-Forwarded-For "^.*\..*\..*\..*" is-forwarded
CustomLog ${APACHE_LOG_DIR}/access.log combined env=!is-forwarded
CustomLog ${APACHE_LOG_DIR}/access.log f5_forwarder env=is-forwarded
These directives should be placed inside a VirtualHost
block.
(this snippet is based on code found here).
Comments