Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running piwik proxy php to hide footprint, IP address is not set correctly when the website being tracked is behind proxy #2900

Closed
mattab opened this issue Feb 2, 2012 · 6 comments
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented Feb 2, 2012

reported in forum post

This is because at https://github.com/piwik/piwik/blob/master/misc/proxy-hide-piwik-url/piwik.php#L101

we simply read REMOTE_ADDR but should also read other parameters that we know could contain IP?

@robocoder
Copy link
Contributor

As reported in that thread, the user got it working after adding adding the proxy_client_headers, proxy_host_headers.

Closing, as this is an environment/configuration issue, already covered by http://piwik.org/faq/how-to-install/#faq_98

@mattab
Copy link
Member Author

mattab commented Feb 4, 2012

Indeed his bug was fixed but technically the problem exists that if the server being tracked is behind a proxy, then IP tracking will not work.

@campino2k
Copy link

For me, the problem was solved by using REMOTE_ADDR as Client Header.

I assume the bug hides in using HTTP_X_FORWARDED_FOR. There are (in my case) 3 IPs, seperated by Comma and it seems that Piwik takes the LAST IP instead of the first.

@anonymous-matomo-user
Copy link

This issue still happening to me. I have followed the instructions in FAQ and tried what campino2k said. Doesnt work for me. Check my post --> http://forum.piwik.org/read.php?2,106184

@ghost
Copy link

ghost commented May 26, 2014

As of Piwik 2.2.2 stable, proxy_client_headers[] = HTTP_X_FORWARDED_FOR seems to have no effect when the CDN server acts as a reverse proxy.

@mattab
Copy link
Member Author

mattab commented May 27, 2014

In 300d3c2: Fixes #2900 Now reading 'HTTP_X_FORWARDED_FOR', 'HTTP_CLIENT_IP', 'HTTP_CF_CONNECTING_IP' and falling back to REMOTE_ADDR
Getting visitor IP via proxy script should now work!

This was also reported in: http://forum.piwik.org/read.php?2,115900

@mattab mattab added this to the 2.x - The Great Piwik 2.x Backlog milestone Jul 8, 2014
@mattab mattab self-assigned this Jul 8, 2014
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

4 participants