All visits in the Visitors in Real time section of the Dashboard appear from source IP X.Y.0.0, which does NOT match the one shown in the REMOTE_ADDR part of the headers. X.Y part is the same but not the last two digits.
The Visitors / Locations panels shows all visits coming from the same place.
As I mentioned, HTTP_X_FORWARDED_FOR shows two IPs sepparated by a comma. The good one is the first one; browsing the code it seemed to me that is takes the last one, but that one does not match X.Y.0.0 either.
There has to be something we are missing. Whan can we do to find the problem?
I did, but I’m not sure what to look for. It only says:
“DEBUG: Visitor IP (was: 130.211.0.0) has been anonymized: X.Y…0.0”
But it does not explain where the IP comes from. Should it give more details if it is being extracted from HTTP_X_FORWARDED_FOR instead of REMOTE_ADDR?
DEBUG: Executing Piwik\Plugins\CoreHome\Tracker\VisitRequestProcessor::afterRequestProcessed()…
DEBUG: Visitor IP (was: ) has been anonymized:
is the real IP from where I am connecting. and have the same two first digits. has those same first digits and then 0.0 This IP is nowhere in the server values; not only it is not using the correct one, it appears to truncate it.
DEBUG: Executing Piwik\Plugins\CoreHome\Tracker\VisitRequestProcessor::afterRequestProcessed()…
DEBUG: Visitor IP (was: [ip4]) has been anonymized: [ip4]
[ip1] is the real IP from where I am connecting. [ip2] and [ip3] have the same two first digits. [ip4] has those same first digits and then 0.0 This IP is nowhere in the server values; not only it is not using the correct one, it appears to truncate it.
DEBUG: Visitor IP (was: [ip4]) has been anonymized: [ip4]
seems to imply that the truncated IP is there before anonymization.
Still, if I disable the IP anonymizer, the IP that is shown in the real time panel is the same as [ip2].
This matches what I thought I saw in the code: when HTTP_X_FORWARDED_FOR contains more than one IP, the one Piwik keeps is the last one. However, in our case, the real IP that we would want to keep is the first one.
Is there anything that can be done about that, either in Piwik or our proxy?