Cloudflare has a concept of authenticated origin pulls. Any clue to how this could be implemented with fly? Or is this something that has to be done in the application itself?
… and so only requests from Cloudflare would be valid. Ones to your-app.fly.dev would not go via Cloudflare, and would be rejected by that check.
Therefore you wouldn’t want Fly to terminate the TLS at its proxy. You would remove the tls in the fly.toml. The TCP would then go straight to your application, so it could handle/verify it.
A simpler (but less good) way to check the request came from Cloudflare would be to use IP ranges. Cloudflare publish their IPs e.g IP Ranges and so you could check the IP of the incoming request. If it’s not part of their published IP range, well it can’t have come from Cloudflare. That approach would rely on being able to get the request IP (so again, you have to consider the Fly proxy’s role as you don’t want its IP to be checked).