Config master SSL site detection update

This commit is contained in:
Clemens Schwaighofer
2022-06-07 18:05:34 +09:00
parent f5b6c639fb
commit 2067a6fe1d

View File

@@ -232,10 +232,16 @@ if (
exit;
}
// set SSL on
if (
(array_key_exists('HTTPS', $_SERVER) && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ||
$_SERVER['SERVER_PORT'] == 443
$is_secure = false;
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
$is_secure = true;
} elseif (
!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ||
!empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on'
) {
$is_secure = true;
}
if ($is_secure) {
define('HOST_SSL', true);
define('HOST_PROTOCOL', 'https://');
} else {