Fix Mixed Content and HTTPS Errors on Netlify
Also appears as:
- Blocked loading mixed active content
- This request has been blocked; the content must be served over HTTPS
- NET::ERR_CERT_COMMON_NAME_INVALID
- SSL certificate problem on Netlify
Symptoms
- Browser console shows mixed content warnings
- Images, scripts, or API calls fail after adding a custom domain
- Site shows 'Not Secure' in the browser bar despite HTTPS being enabled
- Some resources load but others are blocked
What Causes This Error
Hardcoded HTTP URLs in your code
CommonYour source code, CMS content, or database contains URLs that start with 'http://' instead of 'https://'. When your site is served over HTTPS, browsers block these insecure requests.
SSL certificate not yet provisioned
CommonAfter adding a custom domain, Netlify automatically provisions a Let's Encrypt SSL certificate. This can take a few minutes. During this time, HTTPS may not work correctly.
DNS not properly configured
OccasionalIf your DNS records don't point correctly to Netlify, the SSL certificate can't be provisioned. This often happens with CNAME or A record misconfigurations.
External resources served over HTTP
OccasionalThird-party resources (fonts, scripts, images, APIs) that don't support HTTPS will cause mixed content warnings when your site is on HTTPS.
How to Fix It
Fix 1: Replace HTTP URLs with HTTPS
- Search your codebase for 'http://' URLs
- Replace them with 'https://' or use protocol-relative '//' URLs
- Check your CMS content and database for HTTP URLs
- Update any hardcoded API endpoints
grep -r 'http://' src/ --include='*.{js,ts,jsx,tsx,html,css}'Verify: Open the browser console (F12) and check that no mixed content warnings appear.
Fix 2: Wait for SSL certificate provisioning
- Go to Site settings > Domain management in Netlify
- Check if the SSL certificate status shows 'Provisioning'
- Wait up to 24 hours for automatic provisioning
- If it's stuck, click 'Renew certificate' or 'Provision certificate'
Verify: Visit your site with https:// and verify the lock icon appears in the browser bar.
Fix 3: Fix DNS configuration
- In Netlify, go to Site settings > Domain management
- Check the DNS configuration instructions
- Update your DNS records at your registrar to match Netlify's requirements
- Wait for DNS propagation (can take up to 48 hours)
# For apex domain (example.com):
A record → 75.2.60.5
# For subdomain (www.example.com):
CNAME → your-site.netlify.appVerify: Use 'dig example.com' to verify DNS records resolve to Netlify's servers.
Fix 4: Add Content Security Policy headers
- Add a Content-Security-Policy header to enforce HTTPS
- Use the 'upgrade-insecure-requests' directive to automatically upgrade HTTP to HTTPS
- Add this to your netlify.toml or _headers file
[[headers]]
for = "/*"
[headers.values]
Content-Security-Policy = "upgrade-insecure-requests"Verify: Reload the page and verify HTTP resources are automatically upgraded to HTTPS.
How to Prevent This
Always use HTTPS URLs or protocol-relative URLs in your code from the start.
Set up your custom domain and SSL before going live to avoid mixed content issues.
Add Content-Security-Policy headers to enforce HTTPS across your entire site.
Use the Netli.fyi app to monitor your site's SSL certificate status and domain configuration.
Test your site in the browser's developer console after every deploy to catch mixed content warnings early.

Developer Advocate at RevenueCat and creator of Netli.fyi. Building on Netlify since 2019. Writes from hands-on experience deploying dozens of production sites.
Manage Netlify on the go
Download Netli.fyi and monitor your sites, check deploys, and manage your projects from anywhere.