Merge pull request #100 from StefanKrauth/master

Better handling for SSL reverse proxy
This commit is contained in:
redmatrix 2015-10-26 09:32:03 +11:00
commit e0424fe6cc

View File

@ -505,17 +505,12 @@ function script_path() {
else else
$scheme = 'http'; $scheme = 'http';
if(x($_SERVER,'SERVER_NAME')) { if(x($_SERVER,'HTTP_HOST')) {
$hostname = $_SERVER['SERVER_NAME']; $hostname = $_SERVER['HTTP_HOST'];
} }
else { else {
return z_root(); return z_root();
} }
if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
$hostname .= ':' . $_SERVER['SERVER_PORT'];
}
return $scheme . '://' . $hostname; return $scheme . '://' . $hostname;
} }