Cloudflare Proxy + Caddy AutoSSL causes 301 redirect loop

I believe @Whitestrake’s write-up here is relevant to the issue you’re seeing and can guide you to a solution: