Hi all!
I have installed Piwik behind a reverse proxy and had some problems with the images and javascript on the dashboard. Well, the cause is: with this type of installation the $_SERVER[‘HTTP_HOST’] variable contains something like ‘local.hostname’ and not the real host name, which should be like ‘piwik.my-domain.com’. Well, the solution is:
- change lines 115-ff. in core/Url.php as following:
instead of
if(isset($_SERVER['HTTP_HOST']))
{
$url .= $_SERVER['HTTP_HOST'];
}
else
{
$url .= 'unknown';
}
use this one:
if(isset($_SERVER['HTTP_X_FORWARDED_HOST']))
{
$url .= $_SERVER['HTTP_X_FORWARDED_HOST'];
}
elseif(isset($_SERVER['HTTP_HOST']))
{
$url .= $_SERVER['HTTP_HOST'];
}
else
{
$url .= 'unknown';
}
- Replace line 181-ff. in plugins/Login/controller.php as following:
after
$piwikHost = $_SERVER['HTTP_HOST'];
add
if(isset($_SERVER['HTTP_X_FORWARDED_HOST']))
{
$piwikHost = $_SERVER['HTTP_X_FORWARDED_HOST'];
}
That’s all style_emoticons/<#EMO_DIR#>/rolleyes.gif
Regards
Alex