Browse Source

#2062 HTTPS detection during installation for reverse proxies

Alex Trofimov 7 years ago
parent
commit
0b00bb18fe
1 changed files with 8 additions and 1 deletions
  1. 8 1
      install/classes/BxDolInstallSiteConfig.php

+ 8 - 1
install/classes/BxDolInstallSiteConfig.php

@@ -625,7 +625,14 @@ EOF;
 
     protected function proto()
     {
-        return (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) || getenv('UNA_HTTPS') ? 'https://' : 'http://';
+        $sProto = 'http://';
+        if  (
+                (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) || 
+                (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && 'https' == strtolower($_SERVER['HTTP_X_FORWARDED_PROTO'])) || 
+                getenv('UNA_HTTPS')
+            )
+            $sProto = 'https://';
+        return $sProto;
     }
 }