I have a server setup where there’s both a load balancer and an Apache HTTPD server using mod_proxy before the Piwik server. Piwik correctly identifies that it should use HTTP_X_FORWARDED_FOR setting. Unfortunately, it seems to log calls from the load balancer IP, which is the last of the IP’s in the X-Forwarded-For header.
Quoting Apache HTTPD docs: “Be careful when using these headers on the origin server, since they will contain more than one (comma-separated) value if the original request already contained one of these headers.”
Have I configured Piwik somehow wrong or is this a missing feature in Piwik 1.5?
I checked that X-Fowarded-For correctly gives “12.23.34.45,23.34.45.56” on my Piwik server, let’s call that (third) server 45.56.67.78. (So there’s four IP addresses here, one from client and three from my servers.)
Piwik shows that all IP traffic is coming from 23.34.45.56 (the load balancer IP), so it is reading the X-Forwarded-For, but seemingly the last IP in the list, not the first!? If it wouldn’t read that header, it would show 34.45.56.67, the web server?
To clarify the IP addresses: 12.23.34.45 is the originating client, 23.34.45.56 is the load balancer and 34.45.56.67 is the Apache web server with mod_proxy that proxies to Piwik Apache & PHP server 45.56.67.78.
I have the same problem et i would like to know the end of the story.
( the IP addresses: 12.23.34.45 is the originating client, 23.34.45.56 is the load balancer and 34.45.56.67 is the Apache web server with mod_proxy that proxies to Piwik Apache & PHP server 45.56.67.78. )
With the example that you have given, what is the finally configuration: