Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Wrong IP extracted from HTTP_X_FORWARDED_FOR when there is more than one #10342
When Piwik is set up to get the client IP from the proxy header (proxy_client_headers setting) and the header contains more than one IP address, the one Piwik uses is the last one; according to the protocol definition, it should be the first one.
How to reproduce:
A workaround for this is to use a unique header. For example, if using HAProxy in front of Apache you can specify 'option forwardfor header X-Real-Originating-IP' in haproxy.conf and 'HTTP_X_REAL_ORIGINATING_IP' in piwik's config.
At least there is a lot less chance of something else using your custom header.