Mixed Content: The page was loaded over HTTPS, but requested an insecure image
15:46 28 Mar 2018

I have a domain (let's call it Domain1 or https://img.{domain_name_1}.com) where I stored images for serving a wordpress staging website, which is currently hosted on a different server. For the latter I have only an IP public address (so not a real FQDN at the moment), let's call it Domain2 or https://99.999.999.999. On this server I installed a self-signed SSL certificate, just to encrypt the credential I use for phpMyAdmin and wordpress admin area. Meanwhile, Domain1 is SSL secured by Let's encrypt. I can access Domain1 by http or https indifferently, because I have a redirection from http to https. Now, I pointed all my database records about images of the wordpress staging website to the Domain1. When I visit the Domain2 at the page https://99.999.999.999/postcat-postname/, all contents are visible except for images. The Google Chrome Console tool displays:

Mixed Content: The page at '...' was loaded over HTTPS, but requested an insecure image 'http://...'. This request has been blocked; the content must be served over HTTPS.

It is strange and I cannot understand that error because:

  • the Domain1 which serves images for the staging area has been secured;
  • the wp_post of wordpress database for any image shows the link to the pictures with htpps.

This is a picture of the state: Domain1: it serves pictures for Domain2, SSL secured via Let's encrypt Domain2: the wordpress staging website. Self-signed SSL. Media file records in the MySql DB linked to https address of Domain1.

wordpress google-chrome ssl ssl-certificate subdomain