For whatever reason, I can’t get my CloudFlare DNS to properly point to my Fly.io deployment. I have another app running on Fly with the exact same configuration and it seems to be working fine. I’ve even tried pointing this CloudFlare domain to the other app and it works without an issue. Any ideas what I could be doing wrong?
If your app itself is healthy (fly checks list
, fly status --all
and fly logs
are a great jumping off point if you’re not sure yet), then I wonder if the Cloudflare proxy settings are pointed to the correct IPv4/IPv6 addresses.
Specifically, if this app has a shared IPv4, then I wouldn’t expect Cloudflare to be able to connect to it at the IP level.
If this is the case, and you need IPv4, then you can allocate a dedicated IPv4 address, which might be worth trying to see if this clears things up.
- Public Network Services · Fly Docs
- Announcement: Shared Anycast IPv4 - #3 by kurt
- Fly App Pricing · Fly Docs
Alternately, depending on your usecase for Cloudflare proxying, you could turn off proxying to the app as a test, too.
Hi Eli,
Thanks for the advice. In response to your suggestions:
- Nothing is appearing in the logs when trying to load a page.
- I tried setting A name and AAAA name records to point to the app, but I’m hitting the same problem with those.
- I tried toggling the CloudFlare proxying, still the same problem.
I got it working!
- I ran
flyctl ips allocate-v4
to allocate an IPv4 address for my app. - I set up a DNS only (no proxy) A name record that pointed from root
@
to the IP address I generated in step 1.
Awesome, glad to hear! thanks for following up and posting what worked for you
I got the same issue @dmilin
Do you know how to manage to fix this using share ipv4 without allocate dedicate ip ? @eli
Is flyctl ips allocate-v4 still free of charge ?
fly ips allocate-v4 --shared
is free of charge
Use the A, AAAA records but also change the SSL encryption to full. Found this solution from here: Using Fly.io custom domain with CloudFlare as proxy | Michal Májský - blog
Disabling Cloudflare proxy sounds such a bad idea imo.