diff --git a/api/src/Egw.php b/api/src/Egw.php index b92785b2e2..2a24e76096 100644 --- a/api/src/Egw.php +++ b/api/src/Egw.php @@ -138,6 +138,11 @@ class Egw extends Egw\Base substr($_SERVER['HTTP_X_FORWARDED_URI'], 0, $prefix). $GLOBALS['egw_info']['server']['webserver_url']; } + if (isset($_SERVER['HTTP_X_FORWARDED_HOST']) && $GLOBALS['egw_info']['server']['webserver_url'][0] != '/') + { + $GLOBALS['egw_info']['server']['webserver_url'] = ($_SERVER['HTTPS'] ? 'https://' : 'http://'). + $_SERVER['HTTP_X_FORWARDED_HOST'].parse_url($GLOBALS['egw_info']['server']['webserver_url'], PHP_URL_PATH); + } // if no server timezone set, use date_default_timezone_get() to determine it once // it fills to log with deprecated warnings under 5.3 otherwise