notshop-bundle/docs/fly-routing.md
2026-05-26 16:13:33 +00:00

1.1 KiB

Fly.io Edge Routing

Fly.io acts as the routing layer between your domain and your backend(s). During parallel migration it splits traffic between Shopify and your sovereign stack. After cutover it proxies everything to your sovereign stack.

Cost: ~$5/month.


Setup

curl -L https://fly.io/install.sh | sh
flyctl auth login
flyctl launch --copy-config --name yourstore-proxy
flyctl secrets set SHOPIFY_ORIGIN=https://yourstore.myshopify.com
flyctl secrets set SOVEREIGN_ORIGIN=https://yourrepl.replit.app
flyctl secrets set SOVEREIGN_WEIGHT=0
flyctl deploy

Point your domain (DNS CNAME → yourstore-proxy.fly.dev), then add it to Fly:

flyctl certs create yourstore.com
flyctl certs create www.yourstore.com

TLS is automatic.


Traffic splitting

flyctl secrets set SOVEREIGN_WEIGHT=10   # 10% sovereign
flyctl deploy

Ramp: 10 → 25 → 50 → 90 → 100. Each step is a ~30-second deploy.


Full cutover

flyctl secrets set SOVEREIGN_WEIGHT=100
flyctl deploy

All traffic now goes to your sovereign stack. Shopify receives nothing.