Difference between revisions of "Wordpress : Run Behind Reverse Proxy"

From Michael's Information Zone
Jump to navigation Jump to search
(Created page with "==Purpose== To run Wordpress from a docker container on a private subnet, while proxying public access through an Apache proxy. ==Problem== Though the proxy would serve conte...")
(No difference)

Revision as of 11:11, 24 June 2019

Purpose

To run Wordpress from a docker container on a private subnet, while proxying public access through an Apache proxy.

Problem

Though the proxy would serve content over TLS, wordpress and the internal container would not. This would result in missing content because the java script scripts would not be allowed to run.

Fix

The following fix is readily searchable on the internet.[1] Append the following to wp-config.php

if ( (!empty( $_SERVER['HTTP_X_FORWARDED_HOST'])) ||
     (!empty( $_SERVER['HTTP_X_FORWARDED_FOR'])) ) {
    $_SERVER['HTTPS'] = 'on';
}