What does 'Mixed Content: The page was loaded over HTTPS, but requested an insecure resource' mean?
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
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 trustX-Forwarded-Proto. - Old content (CMS images, embeds) stored with
http://links.
How to fix it
- Search the code and env vars for
http://and switch tohttps://(or a relative URL). - Behind a proxy, trust the proxy so redirects keep
https. In Express that'sapp.set('trust proxy', 1). - Add the upgrade header for leftover subresources:
Content-Security-Policy: upgrade-insecure-requestsCheck 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.
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.