Too many redirects occurred trying to open site

Hi @hzb, welcome to the Caddy community.

Frequently when I see this behaviour, it’s because:

  1. The client is connecting to Caddy over HTTPS
  2. Caddy is connecting to the backend server over plain HTTP
  3. The backend server wants Caddy to connect over HTTPS and issues a redirect
  4. Caddy faithfully proxies the redirect back to the client
  5. The client follows the redirect… to HTTPS, the same protocol it was already on
  6. Repeat ad infinitum

Certainly there are no redirects in your Caddyfile that would loop like this. Ensure your upstream server is not sending these redirects mistakenly - this might involve having Caddy proxy it over HTTPS, or maybe changing a setting on the backend application itself.

1 Like