Kavach

Fix · Express / Node

Fix “Mixed content” on Express / Node

Load every script, stylesheet, image and frame over https:// (or use protocol-relative/absolute https URLs).

res.setHeader('Content-Security-Policy', 'upgrade-insecure-requests');
// and replace http:// asset URLs with https:// in templates

Verify the fix

Re-run the Mixed content check after deploying. Test config changes in staging first and keep a rollback: a wrong header can break a site faster than a missing one.

Other stacks: nginx · Apache · Caddy · Cloudflare

Scan your site free → Monitor it continuously