How a request gets answered
Pinch or Ctrl+scroll to zoom; the text is selectable.
Source
·
TheYard
How a request gets answered: three names at Wix, the Netlify edge's two files, the rendering service, and inside the one web app SiteHosts picking the name, ShedMount handing The Shed's name to The Shed, and Stores picking Azure SQL or Cosmos DB
How a request gets answered: three names, one web app, two stores
Read left to right. The name a visitor typed decides everything after it: The Shed or TheYard, and for TheYard, which store answers when the request names none.
The names, at Wix DNS
what the visitor typed
theyard
CNAME theyard-edge.netlify.app
The live site.
No store named: Azure SQL.
theyard-cosmos
CNAME theyard-edge.netlify.app
The second site.
No store named: Cosmos DB.
theshed
CNAME app-theyard-one-ss-...
Bound to the web app with
App Service's certificate.
No edge in front of it.
The edge: Netlify, theyard-edge
HTTPS ends here; the first matching rule wins
1. edge/_redirects
a page, the bare path with its query
To the rendering service as
/site/sql or /site/cosmos.
Bare domain and www: 301.
2. netlify.toml
everything else, proxied
To the one web app, with
X-Yard-Host: the name typed.
The Cosmos DB rule first.
The rendering service
APP-THEYARD-RENDER-SS, Node
render/server.mjs
YARD_SITES: both names, one address
Draws the page from the API,
naming the store on every read
(X-Yard-Store, render/loaders.ts).
The one web app: APP-THEYARD-ONE-SS
one .NET process on the B2 plan; every .NET request lands here
Which name? SiteHosts.Of
api/TheYard.Api/SiteHosts.cs
The Host header first, when App Service
routed by one of the three names;
else X-Yard-Host, only if it names one.
Anything else: no name.
The Shed's name: ShedMount
Composition/ShedMount.cs, ShedApplication.cs
Handed over before TheYard's pipeline:
The Shed's own app from /app/shed,
its pipeline and controllers, no socket.
503 if it could not start.
A Yard name: TheYard's pipeline
Program.cs, then the endpoints
Auth, limits, then the API and the
pages; every endpoint asks
CurrentBackend once per request.
Which store? Stores.cs
Backends, region backends
X-Yard-Store, when a request names one;
else the name's store;
no name (probes, first reads): SQL.
Azure SQL
sqldb-theyard-ss-basic
The relational
store.
Cosmos DB
cosmos-theyard-ss
The document
store.
no page rule
a page
Host: theshed, no edge
the renderer's reads: X-Yard-Host and X-Yard-Store
theyard, theyard-cosmos or none
sql
cosmos
Source: docs/images/request-path.svg, drawn by docs/images/request-path.mjs from edge/_redirects, netlify.toml, SiteHosts.cs, ShedMount.cs, Stores.cs and render/loaders.ts.