From 602b9cd3df9e3d8ed889e568457fb713f4ac63aa Mon Sep 17 00:00:00 2001 From: archipelago Date: Mon, 15 Jun 2026 14:07:39 -0400 Subject: [PATCH] fix(nginx): route /api/peer-content/* to the backend for B3 streaming The B3 streaming proxy endpoint existed in the backend but nginx had no location for /api/peer-content/*, so the browser's requests fell through to the SPA (200 text/html) and media still wouldn't play. Add an NGINX_PEER_CONTENT_BLOCK that bootstrap patches into every server block (forwards Cookie for session auth + Range, proxy_buffering off). Idempotent; covers fresh-ISO nodes too since bootstrap runs on every startup. Verified on .198: after restart the async nginx patch lands and /api/peer-content// returns 401 (reaches backend, auth-gated) instead of the SPA; nginx block present in both server blocks. Co-Authored-By: Claude Opus 4.8 (1M context) --- core/archipelago/src/bootstrap.rs | 32 ++++++++++++++++++++++++++++- tests/production-quality/TRACKER.md | 3 +++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/core/archipelago/src/bootstrap.rs b/core/archipelago/src/bootstrap.rs index 2288711f..92bc8cb9 100644 --- a/core/archipelago/src/bootstrap.rs +++ b/core/archipelago/src/bootstrap.rs @@ -48,6 +48,14 @@ const NGINX_BITCOIN_STATUS_BLOCK: &str = "\n location /bitcoin-status {\n /// sync with the canonical block in image-recipe/configs/nginx-archipelago.conf. const NGINX_LND_PROXY_BLOCK: &str = "\n # LND REST proxy — backend handles auth + CORS\n location /proxy/lnd/ {\n proxy_pass http://127.0.0.1:5678;\n proxy_http_version 1.1;\n proxy_set_header Host $host;\n proxy_set_header Cookie $http_cookie;\n proxy_set_header X-Real-IP $remote_addr;\n proxy_connect_timeout 10s;\n proxy_read_timeout 10s;\n proxy_send_timeout 5s;\n error_page 502 503 = @backend_unavailable;\n error_page 504 = @backend_timeout;\n }\n"; +/// Inserted into every server block lacking the peer-content streaming proxy. +/// Without it, the browser's `