Accessing a specific instance

Hello,

I know we can use the FLY_REGION to forward the request to the correct region, is there a way to access the instance directly a bit like syd.$FLY_APP_NAME.internal but for external requests?

The use case is that we have region switching but some requests like SSO come from servers, and we want to ensure they go to the right region.

Thanks,
Matt

You can set a Fly-Prefer-Region: syd header on requests to target a specific region. You can also set a Fly-Instance-Id: <id> header if you want to target a specific VM.

Is that what you’re looking for?

Ideally something at the dns level so that we can give say the US provider a US callback URL and and EU provider a url that will talk to the EU. The issue is say the EU provider might be using a cloud server that is closer to the US

Ah, we don’t have a great answer for this right now, then. You can add regional IP addresses to your app and set hostnames to point to those. That will get you close. The problem is that those IPs will send traffic across the world if some VMs are down or at capacity.

If you want to try that: fly ips allocate-v4 --help will show you how to specify a region. Youll need to add an ipv6 also to be able to do certificates for any domains you point at those.