From d7a8b523d0415eba492d750c659bd39535d3f6e6 Mon Sep 17 00:00:00 2001 From: theWituch Date: Tue, 18 Aug 2026 14:23:20 +0200 Subject: [PATCH] Add support for HTTPS behind a proxy server in index.php --- index.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.php b/index.php index a1f981d..8640665 100644 --- a/index.php +++ b/index.php @@ -21,6 +21,12 @@ die("Pico requires the PHP extension 'mbstring' to run"); } +// If we're behind a proxy server and using HTTPS, we need to alert Wordpress of that fact +// see also http://codex.wordpress.org/Administration_Over_SSL#Using_a_Reverse_Proxy +if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https') { + $_SERVER['HTTPS'] = 'on'; +} + // load dependencies require_once(__DIR__ . '/vendor/autoload.php');