If your WordPress site is running on private hosting and you notice broken layouts or strange CSS even though SSL is enabled, the problem might be that WordPress is still trying to load content over HTTP instead of HTTPS.
This usually happens when the hosting panel or proxy doesn’t correctly forward the HTTPS status to WordPress.
Solution:
- Open the
wp-config.phpfile in the root directory of your WordPress installation. - Just before the line:
/* That’s all, stop editing! Happy publishing. */
add this code:
if (isset($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) && $_SERVER[‘HTTP_X_FORWARDED_PROTO’] === ‘https’) {
$_SERVER[‘HTTPS’] = ‘on’;
}
- Save the file and exit.
This tells WordPress that your site is running over HTTPS, even when it’s behind Nginx Proxy Manager, ensuring your styles and scripts load correctly.