Hi @hzb, welcome to the Caddy community.
Frequently when I see this behaviour, it’s because:
- The client is connecting to Caddy over HTTPS
- Caddy is connecting to the backend server over plain HTTP
- The backend server wants Caddy to connect over HTTPS and issues a redirect
- Caddy faithfully proxies the redirect back to the client
- The client follows the redirect… to HTTPS, the same protocol it was already on
- 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.