Skip to content

Commit 52b7d5e

Browse files
author
Stanislav Idolov
authored
ENGCOM-3170: Support of error pages behind a load balancer that serves HTTPS #18333
2 parents 1875c8c + 01e5df9 commit 52b7d5e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pub/errors/processor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,8 @@ public function getHostUrl()
265265
$host = 'localhost';
266266
}
267267

268-
$isSecure = (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] != 'off');
268+
$isSecure = (!empty($_SERVER['HTTPS'])) && ($_SERVER['HTTPS'] !== 'off')
269+
|| isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && ($_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https');
269270
$url = ($isSecure ? 'https://' : 'http://') . $host;
270271

271272
$port = explode(':', $host);

0 commit comments

Comments
 (0)