Skip to content

fix: nginx-config drift surfaced by first M0-5/M1-6 deploy#76

Merged
Augustas11 merged 1 commit into
mainfrom
fix/post-m1-deploy-nginx-drift
Jun 12, 2026
Merged

fix: nginx-config drift surfaced by first M0-5/M1-6 deploy#76
Augustas11 merged 1 commit into
mainfrom
fix/post-m1-deploy-nginx-drift

Conversation

@Augustas11

Copy link
Copy Markdown
Owner

Summary

Two drift items the 2026-06-11 Pearl deploy patched live but left unfixed in the repo. Both would re-bite the next deploy. Companion to PR #75, which surfaced them in its description but explicitly didn't carry the fixes.

1. Coordinator nginx config redeclares zones the api vhost already owns

phase4-coordinator/dist/nginx-coordinator.streamvc.live.conf declared limit_req_zone ws_provider_rate and limit_conn_zone ws_provider_conn at lines 18-19. The api.streamvc.live vhost (phase5-gateway/dist/nginx-api.streamvc.live.conf:10-11) already declares them. nginx http-context zones are visible across all vhosts on the same instance — re-declaring fails nginx -t with "limit_conn_zone is already bound". The Pearl coordinator vhost had been dedup'd in place earlier on 2026-06-11 (.bak-pre-dedup-20260611T135903Z artifact survives); the deploy script overwrote that with the still-duped local file and tripped step 6b's nginx -t. Fixed in-place by sed-deleting the two lines on Pearl.

This commit removes the dup declarations from the local file and leaves a comment block explaining the cross-vhost sharing — so a future operator deploying the coordinator vhost standalone (no api vhost on the same nginx) knows to add them back.

2. Gateway deploy script missing the ssl_certificate sed-uncomment that the coordinator script has

phase5-gateway/dist/nginx-api.streamvc.live.conf:34-35 ships those lines commented (first-deploy ACME ordering — nginx -t must pass before certbot has a cert). The coordinator script handles this at its step 6b with an idempotent sed; the gateway script phase5-gateway/dist/deploy-pearl-vps.sh at step 4 just installs the file as-shipped. End-to-end, that would fail nginx -t with "no ssl_certificate is defined for the listen ... ssl". The 2026-06-11 deploy avoided this by switching to a binary-only swap (skipping the nginx step entirely).

This commit adds the same sed pair the coordinator script uses, with a comment cross-referencing the coordinator script's step 6b.

Test plan

  • bash -n phase5-gateway/dist/deploy-pearl-vps.sh — no syntax errors
  • On the next coordinator deploy: step 6b passes nginx -t cleanly (no already bound error)
  • On the next gateway deploy with the full nginx step: step 4 passes nginx -t cleanly (no missing ssl_certificate error)

Out of scope

🤖 Generated with Claude Code

Two drift items the 2026-06-11 deploy hit on Pearl and patched live,
left unfixed in the repo (would re-bite the next deploy):

1. phase4-coordinator/dist/nginx-coordinator.streamvc.live.conf
   re-declared `ws_provider_rate` and `ws_provider_conn` zones that
   the api.streamvc.live vhost already declares. Two vhosts on the
   same nginx instance cannot redeclare the same http-context zone —
   `nginx -t` fails with "limit_conn_zone is already bound." Removed
   the dup declarations; left a comment explaining the cross-vhost
   sharing and the restore step if the coordinator vhost is ever
   deployed standalone.

2. phase5-gateway/dist/deploy-pearl-vps.sh was missing the
   ssl_certificate sed-uncomment block that the coordinator script
   has. nginx-api.streamvc.live.conf ships with those lines commented
   for first-deploy ACME ordering; without the sed, post-cert deploys
   fail `nginx -t` with "no ssl_certificate is defined for the
   listen ... ssl" directive. Added the same idempotent sed pair the
   coordinator script uses at its step 6b.

Both surfaced in PR #75's "companion findings" block. The deploy
session worked around #1 by editing nginx config in place on Pearl
and #2 by switching to a binary-only swap (skipping the script's
nginx step. This commit closes the drift in source.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
EOF
)
@Augustas11 Augustas11 merged commit 5b3f26f into main Jun 12, 2026
2 checks passed
@Augustas11 Augustas11 deleted the fix/post-m1-deploy-nginx-drift branch June 12, 2026 00:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant