If you have a proxy or a CDN sitting in front of your Fly App, you may have hit some difficulty when you were first configuring your certificate. To improve apps behind CDNs, we have now completed our ACME trifecta by adding support for automatic HTTP-01 challenges.
For some background: Our preferred way to generate a certificate is the TLS challenge, which involves a secret handshake with Let’s Encrypt. If you put your app behind a CDN, we no longer get to do that handshake, and your CDN does it wrong (by design!).
Our second option for validating your domain has been a DNS challenge, but this isn’t something we can do for you. You have to add the record yourself (and maintain it). We also see contention with this record; If your provider wants to prove they own the domain, they might bowl over our validation with theirs.
Our new third option is the HTTP challenge, where Let’s Encrypt requests a file and expects a specific response. As long as your CDN passes through these challenges to our network, we can respond to them correctly and generate a certificate. This isn’t something you need to decide on either — we’ll detect whether the TLS or HTTP flow is more appropriate during the process.
Important note: For this flow to work correctly (and securely), we require that you configure your proxy or CDN to point exclusively to your app’s IPv6 address.
Example: Cloudflare
If you have Cloudflare sitting in front of your Fly app, you should create an AAAA
record to your app’s IPv6 address, and nothing else. No A
record, no CNAME
.
That’s it! Your app will get a certificate automatically, and you don’t need to disable Cloudflare’s “Always Use HTTPS” setting, or the “Full (strict)” encryption mode.
(This is only needed if you use Cloudflare’s proxying feature (orange cloud). If you’re just using Cloudflare for DNS, you should set A
& AAAA
(or CNAME
) as you normally would).