webzod
account

Fix the broken HTTPS redirect chain on nginx

headers.redirect.broken · effort: about an hour

Why it matters

Requests to the HTTPS site loop, bounce through too many redirects or get no answer, so visitors see an error instead of the site. This usually comes from two layers redirecting against each other, or from a server that accepts TLS but has no site set up for this name.

The fix

  1. Check the port 443 server for return or rewrite directives that send requests back to the same URL, and the application for its own canonical redirects; keep one owner.
  2. If the handshake completes and nginx sends nothing, the request may be hitting a default server that closes the connection (return 444). Add example.com to server_name of the right port 443 server, run sudo nginx -t and reload.

The examples use example.com. Replace it with your own domain.

Read the documentation (opens in a new tab)

Scan your domain to see whether this applies to you.