Skip to content

Commit 01e5df9

Browse files
ENGCOM-3170: Support of error pages behind a load balancer that serves HTTPS #18333
- Merge Pull Request #18333 from stkams/magento2:2.3-develop - Merged commits: 1. e120448 2. b1b3928 3. 53452fb 4. 320c0aa
2 parents de50d12 + 320c0aa commit 01e5df9

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
if (!empty($_SERVER['SERVER_PORT']) && !in_array($_SERVER['SERVER_PORT'], [80, 443])

0 commit comments

Comments
 (0)