Choorai
HTTPS security block

Fixing Mixed Content Errors

If an HTTPS page requests HTTP APIs/assets/scripts, browsers block those requests. Align all production URLs to https://.

TL;DR

1) Remove http:// URLs 2) Verify env vars and redirects 3) Confirm Mixed Content warnings disappear

주의

Mixed Content: The page was loaded over HTTPS, but requested an insecure resource

원인

A secure HTTPS page requested insecure HTTP resources, so the browser blocked the request.

해결책
  1. Use HTTPS for frontend and backend endpoints
  2. Check env vars like VITE_API_URL for leftover http:// values
  3. Update CDN image/script links to HTTPS
  4. Clear cache and re-test after deployment

Practical checks

.env.production
# Wrong
VITE_API_URL=http://api.example.com

# Correct
VITE_API_URL=https://api.example.com
api.ts
// Wrong
fetch('http://api.example.com/users')

// Correct
fetch(import.meta.env.VITE_API_URL + '/users')

Important

Even with a proxy platform, HTTP origin URLs are blocked by browsers before requests reach your backend.

Prerequisites

  • Your frontend app is served over HTTPS.
  • You can inspect API/static asset URLs used by the page.
  • You can view Mixed Content warnings in browser console.

Validation

  1. All API and asset URLs requested by HTTPS pages use HTTPS.
  2. No Mixed Content warnings appear in browser console.
  3. Blocked requests are gone and network calls return expected statuses.

Troubleshooting

  • Check environment variables for leftover http:// base URLs.
  • Ensure redirects do not downgrade traffic to HTTP mid-chain.
  • Update image/script/CDN links to HTTPS as well.

References

Related Articles

Last updated: February 22, 2026 · Version: v0.0.1

Send Feedback

Opens a new issue page with your message.

Open GitHub Issue