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');