Error fix
How to fix “Mixed content (HTTPS page, HTTP resource)”
A secure page tried to load scripts, images, or XHR over insecure HTTP—browsers block or downgrade.
Updated Apr 20, 2026
Tools that help with this
Fastest fix
Start here first. Step 1 fixes most cases—then work down the list.
- Replace http:// with https:// where supported or use protocol-relative carefully.
- Set Content-Security-Policy upgrade-insecure-requests during migration.
- Fix API base URLs in frontend config and server-rendered HTML.
Why this works
These steps work because it rules out local security software dropping the connection.
What this means
Mixed content weakens security. Modern browsers block active mixed content and warn on passive content depending on policy.
Common causes
Hard-coded http:// URLs
Legacy embeds, CMS fields, or env defaults still point to HTTP.
Third-party scripts
Vendor snippets pulling HTTP assets on an HTTPS site.
Step-by-step fix
Upgrade URLs
- Replace http:// with https:// where supported or use protocol-relative carefully.
- Set Content-Security-Policy upgrade-insecure-requests during migration.
- Fix API base URLs in frontend config and server-rendered HTML.
Related
FAQ
- Why blocked in prod but not dev?
- localhost may be treated differently; always test on HTTPS staging.
- Images only?
- Passive mixed content may load with warnings; active (JS/CSS) is stricter.
- WordPress?
- Update siteurl/home options and run search-replace on content URLs.
Fix related issues
Still stuck? Try these related fixes next.
- Axios network error (browser)Axios could not reach the server—no response object; often CORS, TLS, or offline.
- Next.js middleware redirect loopMiddleware keeps issuing redirects—often auth checks on public paths that bounce forever.
- Service worker fetch failedA service worker intercepted a request and the network failed—offline, CORS, or bad SW scope.
- React hydration mismatchServer HTML and client render differ—often dates, random IDs, or browser-only APIs during SSR.
- NET::ERR_CERT_AUTHORITY_INVALIDThe browser does not trust the certificate chain—self-signed, wrong hostname, or missing intermediate.
Edit your error
Tweak the message and run again—we'll match an existing fix or generate a new page.
Original error message
Mixed Content: The page was loaded over HTTPS, but requested an insecure resource
