aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Krauth <post@stefan-krauth.de>2015-10-25 20:10:35 +0100
committerStefan Krauth <post@stefan-krauth.de>2015-10-25 20:10:35 +0100
commit2030aea175d79494d4d3b69b10978d1ae37f4639 (patch)
tree9381f96345d9eec37830fcf08de438d513b75946
parent911fd6c654435e60167007fd95a4e8ace50806e8 (diff)
downloadvolse-hubzilla-2030aea175d79494d4d3b69b10978d1ae37f4639.tar.gz
volse-hubzilla-2030aea175d79494d4d3b69b10978d1ae37f4639.tar.bz2
volse-hubzilla-2030aea175d79494d4d3b69b10978d1ae37f4639.zip
Better handling for SSL reverse proxy
-rwxr-xr-xinclude/plugin.php9
1 files changed, 2 insertions, 7 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 4d8405b62..c05e8f577 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -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;
}