TheYard's two sites

Pinch or Ctrl+scroll to zoom; the text is selectable. Source · TheYard

TheYard's two sites: two names at Wix, one Netlify edge, two web apps and the rendering service on one App Service plan on Azure, and both stores behind both TheYard's two sites: two names, one edge, three web apps on one plan, both stores behind both A request reads left to right. The name a visitor typed and the path are what differ until the edge; the edge sends a page to the rendering service and everything else to that site's API, and each site opens both stores. The names, at Wix DNS Three CNAMEs and one A record, all at the same edge. One edge: the Netlify site theyard-edge Terminates HTTPS, then proxies by Host. Three files in this repository. Azure: RG-THEYARD-SS, one App Service plan in westus3 Three web apps on one machine: two sites on one image, and the service; both stores open. theyard.stevenstout.biz CNAME -> theyard-edge.netlify.app, TTL 30 min The live site, the name a resume carries. The web app behind it serves Azure SQL Database by default. theyard-cosmos.stevenstout.biz CNAME -> theyard-edge.netlify.app, TTL 30 min The second site, since 1.0.0.100. One label, so any DNS form accepts it. stevenstout.biz and www A 75.2.60.5 and CNAME -> theyard-edge.netlify.app Both forward to the live site with a 301, so a trimmed or retyped address still lands on the app. One certificate Let's Encrypt, issued and renewed by Netlify Four names on it: the bare domain, www, theyard and theyard-cosmos. Adding the alias reissued it within the minute; nothing was bought. edge/_redirects: the name and the path pick the origin the first matching rule wins, top to bottom https://theyard-cosmos.stevenstout.biz/ to the rendering service as /site/cosmos, 200! https://theyard-cosmos.stevenstout.biz/* to the second web app, 200! / to the rendering service as /site/sql, 200! /* to the first web app, 200! (the catch-all, last) stevenstout.biz and www: 301 to theyard.stevenstout.biz A page is the bare path with its query, so the two bare-path rules send every page to the service and the query goes with the rewrite; /index.html is still the API's own page, drawn in the browser. netlify.toml: build only when the edge moves ignore = "git diff --quiet ... -- edge/ netlify.toml" An application push costs no credits; an edge change is one deploy, 15 of the month's 300. This one cost exactly that, read off the meter. APP-THEYARD-SS-ZMNETJ67BN5H2 https://app-theyard-ss-zmnetj67bn5h2.azurewebsites.net Store__Default = sql. Peer__Site = https://theyard-cosmos.stevenstout.biz. Rolled by the Deploy workflow. A web app for containers on PLAN-THEYARD-SS. APP-THEYARD-COSMOS-SS-ZMNETJ67BN5H2 https://app-theyard-cosmos-ss-zmnetj67bn5h2.azurewebsites.net Store__Default = cosmos. Peer__Site = https://theyard.stevenstout.biz. Rolled by Deploy Cosmos. Same image, same plan: one Linux B2, 2 vCPU and 3.5 GB shared by both sites and the rendering service, $24.82 a month. APP-THEYARD-RENDER-SS-ZMNETJ67BN5H2 https://app-theyard-render-ss-zmnetj67bn5h2.azurewebsites.net The rendering service, one process for both sites: /site/sql draws for the first, /site/cosmos for the second. Its own image (render/Dockerfile: the build on Node, nothing else), rolled by Deploy Render on the same push. YARD_SITES names each site's API; a page is read from that API and drawn, then sent with its data in it. It opens no store. Azure SQL Database Entra-only, no SQL login Reached as the managed identity. West US 3, the plan's own region. Azure Cosmos DB no keys on the account Reached as the managed identity. West US 2, one region from the plan. HTTPS, then the Host header picks the rule everything else on theyard: HTTPS to the first web app everything else on theyard-cosmos: HTTPS to the second web app a page on either name: HTTPS to the rendering service, as that site reads the page, the build and the view from that site's API, cookie forwarded both sites open both stores, as their managed identity; the service opens neither the Store bar: each site links to the other, at the same page Each site is one store's site: the web app's default store serves it; a measurement can name the other store for one request with the X-Yard-Store header. The edge retires at the registrar transfer around the end of October 2026; both names then become two records at Cloudflare, and a Worker takes the rendering function with it. Source: docs/images/two-sites.svg in the repository, drawn by docs/images/two-sites.mjs and redrawn when a name, a rule or a site changes.