Plesk

Website running on Plesk has a broken layout when opening via HTTPS: blocked:mixed-content

Symptoms

Cause

The website uses HTTP links inside its code. Since the website is accessed through HTTPS this causes what is known as "mixed content", which is not allowed by browsers as it is a bad practice for security.

Resolution

Adjust the website code or configure the following Content-Security-Policy header to force web server to upgrade HTTP requests to HTTPS.

  1. Log into Plesk

  2. Go to Domains > example.com > Hosting & DNS > Apache & nginx

  3. Insert the following rules into Additional nginx directives OR Additional Apache directives sections:

    • For nginx:

      add_header Content-Security-Policy upgrade-insecure-requests;

    • For Apache:

      Header always set Content-Security-Policy "upgrade-insecure-requests;"

Exit mobile version