diff options
-rwxr-xr-x | include/plugin.php | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/include/plugin.php b/include/plugin.php index c05e8f577..8749f3fbf 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -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(); |