If you install Piwik, connecting through a reverse proxy (https-to-http), the following line should be automatically added to your config/config.ini.php file during the Piwik installation:
[General] assume_secure_protocol = 1
If you install Piwik from behind the reverse proxy (where Piwik can’t detect https will be used), you should set the above manually. Also, depending on your proxy server, the Visitor IP is set in a different HTTP Header which should also be automatically detected on install and added to your config/config.ini.php:
[General] ; Uncomment line below if you use a standard proxy ;proxy_client_headers = HTTP_X_FORWARDED_FOR ;proxy_host_headers = HTTP_X_FORWARDED_HOST ; Uncomment line below if you use CloudFlare ;proxy_client_headers = HTTP_CF_CONNECTING_IP ; Uncomment line below if you use another proxy (that sets Client-IP header) ;proxy_client_headers = HTTP_CLIENT_IP
If Piwik was unable to detect your proxy configuration, you may add these lines manually in your Piwik config.ini.php file (remove the leading “;” character to enable the setting).
- an alternative solution on Apache 2.4 and Apache 2.5 is to use
mod_remoteipto override the client IP with the IP as provided by a proxy or load balancer. Then you won’t need to specify these Piwik config settings.
- If your server is configured behind an outgoing proxy, check out this FAQ: outgoing Proxy easy setup in Piwik. You might also be interested in How do I force Piwik login to use SSL (https)?.