Answer 404 for unrouted paths, and keep the route lists honest

web/nginx.conf ended its try_files chain in an unconditional /200.html, so
every path the site does not have -- /wp-login.php, /.env, a typo'd inbound
link -- came back as the SPA shell with a success status. It now answers 404,
which needs nginx to know which routes exist: most it infers from the build
output, but dynamic routes and ones that never opted into prerendering have no
file on disk and are listed by hand.

Those hand-maintained lists drift, and the drift is invisible until it ships:
vite dev and npm run preview route from the client manifest and never read
nginx.conf, so a new dynamic route works everywhere a developer would look and
404s in production. hack/check-web-routes.sh compares the lists against
web/src/routes, and a workflow runs it. Its own workflow rather than another
job on license-compliance.yml, which already carries one unrelated check.

Also turns absolute_redirect off. With nginx's default the trailing-slash
canonicaliser reconstructs the origin from its own listen port, so a request
for https://demo.cairnobs.org/settings/ was answered with
Location: http://127.0.0.1:3000/settings -- the container's internal address,
unreachable from the client, and downgraded to http on the way. Verified by
curl against the built image; it was latent here before the canonicaliser
existed too, through the directory redirect on /dev.
This commit is contained in:
2026-08-28 15:55:28 -07:00
parent 25d5d9ce2e
commit e8b6a8bc2e
5 changed files with 265 additions and 9 deletions
+7
View File
@@ -25,6 +25,13 @@ monorepos (Kubernetes among them).
history, then keeps generating in real time. Distinct from
`benchmark-fixture/` (volume, for the Phase 2 latency benchmark) and
`windows-fixture/` (correctness, for the Windows ingest path).
- `check-web-routes.sh` — asserts `web/nginx.conf`'s hand-maintained
route allowlists still match `web/src/routes`. `nginx.conf` 404s
unknown paths, so it has to name the routes that have no prerendered
file to match (dynamic ones, and any route without `prerender = true`).
Drift here breaks production only — dev and `npm run preview` never
read `nginx.conf` — so this runs in CI, like
`check-tenant-boundary.sh`.
- `demo-seed/` — the rest of the demo deployment: its reset script,
dashboards, alert rules, and the systemd unit that runs
`demo-simulator`.