Report this

What is the reason for this report?

Wordpress site not formatting correctly

Posted on April 27, 2017

Hi,

I’ve been through the process of setting up some LXC containers running NGINX and then went through install of an LEMP stack on one of them, I have HAProxy set up to do TLS termination and have let’s encrypt certs set up so that I have SSL enabled.

I’ve now been through setting up MySQL and then wordpress install, but my wordpress installs don’t look right. For an example see here: https://benefitsofbamboo.com/

Can anyone tell me what is wrong?

Thanks



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@denright

WordPress doesn’t handle proxies all that well, even if you are sending the correct headers over. I ran in to this issue when setting up a cluster for a client just last week.

A simple solution is to force SSL by modifying wp-config.php.

Find:

define('WP_DEBUG', false);

Directly below that, add:

if ( $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' )
{
    $_SERVER['HTTPS']       = 'on';
    $_SERVER['SERVER_PORT'] = 443;
}

Save wp-config.php and reload the page.

Hi @denright

You need to modify your WordPress installation to run over https instead of http. https://benefitsofbamboo.com/wp-admin/options-general.php

You might need to modify posts and edit links and images to also use https. Or you could use a plugin like Better Search Replace to do it automatically. https://wordpress.org/plugins/better-search-replace/

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.