Client IPs not appearing in Visitors log

We are having an issue where the source client IPs are not appearing in the Visitors log. We have a load balancer routing the traffic to the PIWIK server, and all the entries have the load balancer’s IP address as the source. We’ve tried to follow the FAQ in How to configure PIWIK behind a proxy (How do I configure Piwik when the server is installed behind a proxy? - Analytics Platform - Matomo), but it’s still not working. We’ve also modified the apache configuration (HOWTO: Log Client IP AND X-Forwarded-For IP in Apache - Techstacks HOWTO’s) to log the client IP, so the access_log is actually showing the source IP and not that of the load balancer. We are using X-Forwarding-For to get the source client IP to the backend web servers and PIWIK. Are we missing something?

Many thanks in advance!

Hi,

any updates on this? We are currently facing the same issue. The Apache access_log looks good (shows the correct X-Forward-For) but Piwik only shows the IP of the last reverse proxy (which is actually localhost in IPv6 ::1).

Best,
Adam

If you believe there is a bug in Piwik feel free to create a bug report at: Issues · matomo-org/piwik · GitHub

Hi Matt,

we changes some parts of the config and restarted several times and somehow it is working now. I did not figure out yet why but it seems to be okay now.

Cheers,
Adam

Note: For users of Piwik behind RackSpace Cloud LB. To get visitor IP. Appears to be working.

I had to add to the config/config.ini.php [General Section]:

; de facto standard (X-Forwarded-For)
proxy_client_headers[] = "HTTP_X_FORWARDED_FOR"
proxy_host_headers[] = “HTTP_X_FORWARDED_HOST”