Infinite refresh loop in browser clients, with “Invalid or expired session” log error spam

I installed an Turnkey Mattermost server on a local Proxmox server, and after I setup the DNS and redirect it with Cloudflare, I see the infinite refresh loop, and if I turn off the CloudFlare redirect, I keep receiving the Invalid or expired session.

What can I do? I downloaded the latest version.