Wordpress site not formatting correctly


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:

Can anyone tell me what is wrong?


Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


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.


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.

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.