Fix · Caddy
Fix “HTTP redirects to HTTPS” on Caddy
Answer every http:// request with a 301 redirect to the https:// URL (and enable HSTS once that works).
yoursite.com {
redir https://{host}{uri} permanent
}
Verify the fix
Re-run the HTTP redirects to HTTPS 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 · Express / Node · Cloudflare