"flyctl deploy": "--region" value is not respected

In the flyctl deploy command, I pass a specific region value to --region flag. Looks like it’s not respected, it picked the closest region to me automatically.

flyctl apps create my-dummy-app
flyctl deploy -a my-dummy-app -i nginx -r lax

But the app is launched at sin (that’s the closest region for me).

Also it shows 502 error when I try to visit it in the browser and I can’t control its health checks.

Try PRIMARY_REGION=lax (typically used for Fly-automated Postgres) in your fly.toml and see if fly deploy --strategy immediate then does the right thing in deploying to lax (ref).

fly deploy isn’t quite the command I’d use to set regions. You probably know this, but the specialist command is fly regions set ...: VMs not redeploying to specified region - #4 by Yaeger

If you’d like to add a region, then you’d use fly regions add ...

For setting up backup regions and list existin regions, ref: Avoid a region - #2 by kurt

And to set one vm per region, see: Scaling not prioritizing primary region - #8 by kurt

1 Like

Already tried PRIMARY_REGION = "lax", didn’t work. I’ll try flyctl regions and see if that works.

1 Like

flyctl regions set worked like a charm! Thanks. :smiling_face_with_three_hearts:

1 Like