diff --git a/wp-admin/setup-config.php b/wp-admin/setup-config.php
index 4ae670d..117668e 100644
--- a/wp-admin/setup-config.php
+++ b/wp-admin/setup-config.php
@@ -19,6 +19,13 @@ define( 'WP_INSTALLING', true );
  */
 define( 'WP_SETUP_CONFIG', true );
 
+/**
+ * Detect whether we are running behind a TLS Termination Proxy.
+ */
+if ( $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ) {
+        $_SERVER['HTTPS']='on';
+}
+
 /**
  * Disable error reporting
  *
