Fix 502 errors during Fly.io proxy deploys

The health check returned 200 immediately on nginx start, before
Tailscale connected. Fly.io routed traffic to the new machine with
a cold proxy cache and no MagicDNS, causing upstream DNS timeouts.

Defer the health check by returning 503 until a sentinel file
(/tmp/tailscale-ready) is created after Tailscale connects. This
keeps the old machine serving traffic during the startup window.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-02-09 11:06:41 -08:00
commit b667f21e10
3 changed files with 9 additions and 4 deletions

View file

@ -0,0 +1 @@
Fix 502 errors during Fly.io proxy deploys by deferring health check until Tailscale is connected.