I am no Open Source software expert. The Linux World is so full of specialized configurations and the same is true with many Open Source software. A Google search will reveal many common problems and fixes for most problems.
The fix for enabling self-hosted WordPress to work with a self-host reverse proxy was elusive. I tried many configurations, but the common thread was adding specific information into a file called wp-config.php file that tells Word Press how to respond to the Apache Web Server that is included with the docker install. The other hurdle for the linux challenged is to get into the docker container to edit the specific file.
Just know that the wp-config.php file can exist in different locations depending on how Word Press is installed. That info can be found in a web search. The following information was placed in my file, and as a precaution, the container restated, the browser cache flushed and tried again….and it worked The FIX is in!
Your domain will vary.
Your domain will be different, but place this at the top of the file under the <?php>
define(‘.COOKIE_DOMAIN.’, ‘wp.tottentechworks.com’);
define(‘.SITECOOKIEPATH.’, ‘.’);
if(isset($_SERVER[‘HTTP_X_FORWARDED_FOR’])) {
$list = explode(‘,’,$_SERVER[‘HTTP_X_FORWARDED_FOR’]);
$_SERVER[‘REMOTE_ADDR’] = $list[0];
}
define( ‘WP_HOME’, ‘https://wp.tottentechworks.com’ );
define( ‘WP_SITEURL’, ‘https://wp.tottentechworks.com’ );
$_SERVER[‘HTTP_HOST’] = ‘wp.tottentechworks.com’;
$_SERVER[‘REMOTE_ADDR’] = ‘https://wp.tottentechworks.com’;
$_SERVER[ ‘SERVER_ADDR’ ] = ‘192.168.1.105’;
if ($_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’)
$_SERVER[‘HTTPS’]=’on’;
At the bottom of the file, enter this data and change your domain name.
define(‘WP_HOME’,’https://wp.tottentechworks.com’);
define(‘WP_SITEURL’,’https://wp.tottentechworks.com’);
Restart your container or server. Make sure you reverse proxy is set properly and the site should now come online. Best of luck!
