When running behind a reverse proxy with ssl, the config variable assume_secure_protocol is set to 1. This seems to set the url protocol (https) correctly everyplace except in the dashboard javascript. The piwik.piwik_url variable in the global js still has "http" for the protocol. To fix this I added the Piwik::isHttps check to core/View.php after $this->piwikUrl is set (line 45):
if(Piwik::isHttps()
&& strpos($this->piwikUrl, 'http://') === 0)
{
$this->piwikUrl = str_replace('http://', 'https://', $this->piwikUrl);
}
(In [5068]) * fixes #2594 - apply gator's patch