OverviewFilesCommitsIssuesDocsReleasesPeers

7rnx-proxy commits / d7ac81f

fix: emit wildcard vhosts LAST — they shadow every host added after them
Apache matches name-based vhosts in configuration order, and generateVhosts emitted them in registry insertion order. So `ServerAlias *.7rnx.net` shadowed every vhost registered after the wildcard was added (2026-07-03). pds and p2p only ever worked because they predate it. Found deploying ap.7rnx.net: it was answered by the atproto membrane on :3399 instead of ap-bridge on :3400. Nothing errored — the request simply resolved to the wrong backend, and the only visible symptom was an XRPC MethodNotImplemented for an ActivityPub path. Sorting wildcards last is sufficient and order-stable for everything else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
d7ac81f34cfa8f981c779a2c432ed71601ce6798
by plankatron <fleeky@gmail.com> · 2026-08-01T01:44:09.000Z

Changed files (1) +13 -1

lib/config-generator.js +13 -1
……@@ -26,7 +26,19 @@ export function generateVhosts (registry) {
2626 const nodeMap = new Map()
2727 for (const node of registry.nodes) nodeMap.set(node.petname, node)
2828
29 for (const h of registry.hosts || []) {
29 // ★ Wildcard vhosts MUST be emitted last. Apache matches name-based vhosts in configuration
30 // order, so a `ServerAlias *.7rnx.net` block shadows every specific vhost defined after it.
31 // Registry order is insertion order, so before this sort any host registered AFTER the
32 // wildcard silently resolved to the wildcard's backend — pds/p2p only ever worked because
33 // they predate it. Found when ap.7rnx.net (added later) was answered by the atproto membrane
34 // on :3399 instead of ap-bridge on :3400, with no error anywhere to indicate why.
35 const orderedHosts = [...(registry.hosts || [])].sort((a, b) => {
36 const aw = a.serverName.startsWith('*.') ? 1 : 0
37 const bw = b.serverName.startsWith('*.') ? 1 : 0
38 return aw - bw
39 })
40
41 for (const h of orderedHosts) {
3042 const node = nodeMap.get(h.node)
3143 if (!node) continue
3244 assertSafe(node.ip, 'node ip')