parent
70cb883547
commit
b80315e238
1 changed files with 13 additions and 1 deletions
|
@ -311,7 +311,19 @@ function server_url($server)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $scheme.'://'.$server['SERVER_NAME'].$port;
|
if (isset($server['HTTP_X_FORWARDED_HOST'])) {
|
||||||
|
// Keep forwarded host
|
||||||
|
if (strpos($server['HTTP_X_FORWARDED_HOST'], ',') !== false) {
|
||||||
|
$hosts = explode(',', $server['HTTP_X_FORWARDED_HOST']);
|
||||||
|
$host = trim($hosts[0]);
|
||||||
|
} else {
|
||||||
|
$host = $server['HTTP_X_FORWARDED_HOST'];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
$host = $server['SERVER_NAME'];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $scheme.'://'.$host.$port;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SSL detection
|
// SSL detection
|
||||||
|
|
Loading…
Reference in a new issue