Health check-based routing

I am currently using Fly.io for one of my server endpoints but still have my main NextJS application on AWS.

I wish to migrate my main NextJS application to Fly.io for the same AZ as my database and server in Fly.io, however, uptime is important for my application for real-time usage.

Is there a way to have health check-based routing such that my custom app domain routes to my Fly.io deployed application and if there are any downtimes with the Fly.io AZ my app is hosted in, for it to route to my AWS deployed application as the backup?

I’d like to thoroughly know how to do this before I undergo this decently large migration effort with my main application along with the rest of the numerous AWS microservices/dependencies my application is using for this to happen.

Thanks,
Chris

I see this section on Heath check-based routing but it looks to be for within Fly.io network and machine routing and not for my above concern: App Availability and Resiliency · Fly Docs

The recommendation is to scale your machines across multiple regions to avoid outages. There were some global outages on Fly over the past few months though…
Sounds like you want a failover. Cloudflare /Cloudfront has this feature I think. Look at their docs to see how to configure it.

Is there a Fly.io API endpoint for an app in an availability zone, or for the availability zone itself, that returns an OK or failed response if it’s either running or there is an outage?