diff --git a/config/application.php b/config/application.php index 269b977947..bb06227d15 100644 --- a/config/application.php +++ b/config/application.php @@ -89,6 +89,14 @@ Config::define('SCRIPT_DEBUG', false); ini_set('display_errors', 0); +/** + * Allow WordPress to detect HTTPS when used behind a reverse proxy or a load balancer + * See https://codex.wordpress.org/Function_Reference/is_ssl#Notes + */ +if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { + $_SERVER['HTTPS'] = 'on'; +} + $env_config = __DIR__ . '/environments/' . WP_ENV . '.php'; if (file_exists($env_config)) {