Fix fly-deploy WARNING by starting nginx before Tailscale

The deploy WARNING ("app is not listening on the expected address") was
caused by a race: start.sh ran Tailscale setup (~5-10s) before starting
nginx, so Fly's post-start socket check found nothing on port 8080.

Fix by starting nginx first and deferring upstream DNS resolution to
request time via resolver + variable in proxy_pass. DNS results are
cached for 30s per worker to avoid per-request lookups.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Erich Blume 2026-02-09 07:00:19 -08:00
commit 0e23adcc71
3 changed files with 18 additions and 3 deletions

View file

@ -0,0 +1 @@
Fix fly-deploy WARNING by starting nginx before Tailscale, deferring upstream DNS resolution to request time.