Explorar o código

#2062 HTTPS detection during installation for reverse proxies

Alex Trofimov %!s(int64=7) %!d(string=hai) anos
pai
achega
0b00bb18fe
Modificáronse 1 ficheiros con 8 adicións e 1 borrados
  1. 8 1
      install/classes/BxDolInstallSiteConfig.php

+ 8 - 1
install/classes/BxDolInstallSiteConfig.php

@@ -625,7 +625,14 @@ EOF;
 
 
     protected function proto()
     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;
     }
     }
 }
 }