mirror of
https://codeberg.org/streams/streams.git
synced 2024-09-20 01:15:13 +00:00
make use of http_host vs. server_name configurable in script_path()
This commit is contained in:
parent
e0424fe6cc
commit
7f3df847a2
1 changed files with 10 additions and 2 deletions
|
@ -504,9 +504,17 @@ function script_path() {
|
|||
$scheme = 'https';
|
||||
else
|
||||
$scheme = 'http';
|
||||
|
||||
// Some proxy setups may require using http_host
|
||||
|
||||
if(x($_SERVER,'HTTP_HOST')) {
|
||||
$hostname = $_SERVER['HTTP_HOST'];
|
||||
if(intval(get_app()->config['system']['script_path_use_http_host']))
|
||||
$server_var = 'HTTP_HOST';
|
||||
else
|
||||
$server_var = 'SERVER_NAME';
|
||||
|
||||
|
||||
if(x($_SERVER,$server_var)) {
|
||||
$hostname = $_SERVER[$server_var];
|
||||
}
|
||||
else {
|
||||
return z_root();
|
||||
|
|
Loading…
Reference in a new issue