nginx: serve the canonical-forms essay on spiritwriter.ai - #19
Merged
Conversation
The essay deployed but was unreachable: spiritwriter.ai's server block serves /landing.html for every URL it doesn't name, and never tries $uri. So /computed-not-assigned.html returned 200 with the landing page in it — the same failure as a 404, minus the signal that anything was wrong. The page was added to that host without touching the vhost that serves it. Rendering was verified; reachability was not. Fixed with an explicit location rather than switching the catch-all to `try_files $uri /landing.html`. The docroot is shared with news.spiritwriter.ai, so a $uri-first rule would also expose every news page and article on the marketing domain — a wider change than this needs, with duplicate-content consequences. Adds a test that reads the vhost block and asserts each standalone page published for that host has a location resolving to the real file. The class of bug is easy to repeat, because the symptom is a 200. Not syntax-checked: neither nginx nor a docker daemon is available in this environment. The new block is structurally identical to the existing `location /static/` in the same file. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RyrQHRdQXXsfTbKvRnxKjA
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/computed-not-assigned.htmldeployed but was unreachable — it served the landing page instead.Cause
spiritwriter.ai's server block never tries
$uri:Every URL on that host that isn't
/static/,/favicon.icoor/healthzresolves to/landing.html. The block's own comment says so — "every URL serves /landing.html" — because when it was written, spiritwriter.ai was one page.#18 added a second page to that host and never touched the vhost serving it. The page's rendering was verified; its reachability was not. The failure mode is a 200 with the wrong content, which is why it looked like a working link that went to the home page rather than a broken one.
Fix
An explicit location for the page:
Deliberately not
try_files $uri /landing.htmlon the catch-all. That docroot is shared with news.spiritwriter.ai, so a$uri-first rule would also expose every news page and article on the marketing domain — a much wider change than this needs, with duplicate-content consequences across two hosts.The trade-off is that each future standalone page needs its own location. If long-form pages become a category, the better shape is a
/essays/prefix and onelocation /essays/block — but that changes an already-published URL (the spiritwriter-core README,docs/canonical-forms.md, and the essay's own canonical tag all point at the current path), so it isn't worth doing for one page.Guard
A test reads the spiritwriter.ai server block and asserts each standalone page published for that host has a location that resolves to the real file. This bug is easy to repeat precisely because the symptom is a 200, and the existing tests all passed while the page was unreachable — they check what the generator writes, not what the server will hand back.
Suite: 72 passed.
Not verified
location /static/in the same file, butnginx -thas not run against it.Generated by Claude Code