mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 05:35:12 +00:00
Merge pull request #100 from StefanKrauth/master
Better handling for SSL reverse proxy
This commit is contained in:
commit
e0424fe6cc
1 changed files with 2 additions and 7 deletions
|
@ -505,17 +505,12 @@ function script_path() {
|
|||
else
|
||||
$scheme = 'http';
|
||||
|
||||
if(x($_SERVER,'SERVER_NAME')) {
|
||||
$hostname = $_SERVER['SERVER_NAME'];
|
||||
if(x($_SERVER,'HTTP_HOST')) {
|
||||
$hostname = $_SERVER['HTTP_HOST'];
|
||||
}
|
||||
else {
|
||||
return z_root();
|
||||
}
|
||||
|
||||
if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
|
||||
$hostname .= ':' . $_SERVER['SERVER_PORT'];
|
||||
}
|
||||
|
||||
return $scheme . '://' . $hostname;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue