Setting up Cloudflare for caddy 2

Hello, I switched my site to Vercel after 2 days of trying to make Caddy work with Cloudflare…

I still didn’t figure out why it returned 522 on Full mode and Maximum redirects on Flexible mode.

I had :80 and :443 enabled in ufw and tried disabling Cloudflare Proxy

nothing of that worked