Config.ini.php and CloudFlare settings

Hi there,

I use Piwik installed on piwik.domainA.com. The installation is used to track multiple sites (domainB.com, domainc.com etc), all set up in their own ‘profiles’, which seems to be working OK.

All of these sites are routed via CloudFlare. I have read on these forums, and other places online, that is order to get Piwik to report correctly with CloudFlare that some changes are needed to config.ini.php.

I have added the following (exactly as is) under [General]

proxy_client_headers[] = HTTP_CF_CONNECTING_IP
proxy_client_headers[] = HTTP_CLIENT_IP
proxy_client_headers[] = HTTP_X_FORWARDED_FOR
proxy_host_headers[] = HTTP_X_FORWARDED_HOST

proxy_ips[] = 204.93.240.0/24
proxy_ips[] = 204.93.177.0/24
proxy_ips[] = 199.27.128.0/21
proxy_ips[] = 173.245.48.0/20
proxy_ips[] = 103.21.244.0/22
proxy_ips[] = 103.22.200.0/22
proxy_ips[] = 103.31.4.0/22
proxy_ips[] = 141.101.64.0/18
proxy_ips[] = 108.162.192.0/18
proxy_ips[] = 190.93.240.0/20
proxy_ips[] = 188.114.96.0/20
proxy_ips[] = 197.234.240.0/22
proxy_ips[] = 198.41.128.0/17
proxy_ips[] = 162.158.0.0/15

The IPs are those listed publicly on the CloudFlare website (IP Ranges | Cloudflare). I’m not sure if I’ve got his right or now, I removed many ';'s from the beginning of these line as for some reason I though the semi-colon meant they were commented out, but I could be totally wrong on that.

If anyone who is more familiar with this than me could have a quick look over these line it would be much appreciated.

Thanks

I’m not sure Piwik will understand those IP’s since that’s describing them as blocks, not singular IP’s. You shouldn’t actually need to set those, so you can get rid of them.