Add proxy in front

This commit is contained in:
Erik Gustafson
2022-01-04 23:25:26 +01:00
parent 27c8961fef
commit 29f6e0fbd9
7 changed files with 187 additions and 105 deletions

View File

@ -79,6 +79,22 @@ $table_prefix = 'wp_';
*/
define( 'WP_DEBUG', false );
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
$_SERVER['HTTPS']='on';
$_SERVER['SERVER_PORT']=443;
}
if ( isset($_SERVER['HTTP_X_FORWARDED_HOST'])) {
$_SERVER['HTTP_HOST'] = $_SERVER['HTTP_X_FORWARDED_HOST'];
define('WP_SITEURL', 'https://{{website.external_hostname}}');
define('WP_HOME', 'https://{{website.external_hostname}}');
}else{
define('WP_SITEURL', "http://{$_SERVER['HTTP_HOST']}");
define('WP_HOME', "http://{$_SERVER['HTTP_HOST']}");
}
/* That's all, stop editing! Happy publishing. */
/** Absolute path to the WordPress directory. */