Skip to content

What does 'Mixed Content: The page was loaded over HTTPS, but requested an insecure resource' mean?

Short answer

Your HTTPS page tried to load something over plain http://, such as an API URL, script, iframe or image, and the browser blocked or auto-upgraded it. Change the URL to https://, usually an env var like API_URL=http://.... Add Content-Security-Policy: upgrade-insecure-requests as a safety net.

Last updated 2026-11-25 · Reviewed by ProofForge

The exact error

text
Mixed Content: The page at 'https://app.example.com/' was loaded over HTTPS, but requested an insecure resource 'http://api.example.com/data'. This request has been blocked; the content must be served over HTTPS.

Why it happens

  • An env var or hard-coded base URL still says http:// (often copied from local dev).
  • The backend redirects to http:// because it sits behind a proxy and doesn't trust X-Forwarded-Proto.
  • Old content (CMS images, embeds) stored with http:// links.

How to fix it

  1. Search the code and env vars for http:// and switch to https:// (or a relative URL).
  2. Behind a proxy, trust the proxy so redirects keep https. In Express that's app.set('trust proxy', 1).
  3. Add the upgrade header for leftover subresources:
http
Content-Security-Policy: upgrade-insecure-requests

Check it's fixed

Reload with DevTools → Console open. No 'Mixed Content' lines should appear, and the Security panel shows a secure origin.

Check your live app

A free, read-only public-surface scan. It cannot diagnose private sessions or every cause described above.

Read-only. No writes or row contents.

FAQ

Why is it blocked and not just warned?

Browsers block mixed scripts, fetch/XHR and iframes outright because an attacker on the network could change them. Some images get auto-upgraded instead.

Is upgrade-insecure-requests enough?

It fixes subresources that also exist on https. Your API must actually serve HTTPS.

Does it affect SEO?

Indirectly. Broken features and 'Not secure' signals hurt trust. Make sure http:// redirects to https:// too.

Sources

Related

Read as Markdown · Scan methodology