I’ve trying to come up with a solution for this, but to no avail. I set up my site with CloudFlare, but now all my visitors in Piwik have CloudFlare’s IPs. I found this thread, and although I tried the suggested solution, I can’t seem to make it work. What I’ve done so far is copying the following lines to my config.ini.php:
Thanks for you reply. It was my bad, I forgot I was using the “piwik.php proxy script,” instead of the Javascript code, with this particular installation. Just for completion, if anyone’s trying to achieve the same, you just have to modify this line, in your piwik.php file:
I’m having the same issue and wasnt sure if I should revive an old thread on the same topic or start a new one.
My scenario is this:
my piwik server is on cloudflare + SSL. I have added to config:
proxy_client_headers[] = HTTP_CF_CONNECTING_IP
I have also added mod_cloudflare to apache.
My website is on a seperate server and also uses Cloudflare + SSL + the piwik tracker proxy. I have added mod_cloudflare to apache.
My piwik server does correctly log visitors, but all the visitors have a Cloudflare IP address. I have tried modifying the piwik.php file, however the code seems to have changed from the example mod posted by daat. only the last line in the code includes [REMOTE_ADDR]:
thanks for the reply - I’m not sure if its a bug, hence my posting in a Cloudflare related thread.
I have checked the tracker proxy and it is the current version - thank you for the suggestion.
I’ve quite diligently searched the forum for information about the steps necessary to implement Piwik with Cloudflare, and as far as I can see I’ve done everything suggested:
install apache mod_cloudflare
modfied the piwik config file
I was unclear if the issue originates with the fact that both the piwik server AND the website being tracked are both on Cloudflare, if there is anything additional I need to do to account for this factor?
These ones show the correct IP:
HTTP_X_FORWARDED_FOR
HTTP_CF_CONNECTING_IP
REMOTE_ADDR
I loaded a page on the site and looked in piwik console at the same time, and the pageload showed a Cloudflare IP address,
Does the fact that the array dump shows my IP correctly mean that the proxy tracker callhome to my Piwik server is where the CF IP is being introduced, due in some way to the fact the Piwik server itself is also on Cloudflare?
These ones show the correct IP:
HTTP_X_FORWARDED_FOR
HTTP_CF_CONNECTING_IP
REMOTE_ADDR
I loaded a page on the site and looked in piwik console at the same time, and the pageload showed a Cloudflare IP address; I dont see any cloudflare addresses in the array dump data so I’m not sure where its coming from…
Does the fact that the array dump shows my IP correctly mean that the proxy tracker callhome to my Piwik server is where the CF IP is being introduced, due in some way to the fact the Piwik server itself is also on Cloudflare?