It took me a while to find out how to make https works with Open source Anvil and Cloudflare
First, you need to set A record of DNS management to the IP of the server.
Run anvil-app-server --app api --origin https://you_domain.com --letsencrypt-staging
Ignore error 403 or 400, access your domain https://you_domain.com
Change cloudflare SSL/TLS encryption mode to Full
Good luck