feat: serve docs on docs.<apex> from the landing container - #100
Merged
Conversation
docs.agentage.io is routed to the same landing service: the app rewrites the docs tree onto that host's root and 308s the apex /docs* URLs over to it. Canonical, sitemap and llms.txt docs entries now emit docs-origin URLs. Localhost / unknown hosts are untouched, so the deploy e2e gate is unaffected.
|
✅ CI - Verify PASSED Commit:
|
vreshch
marked this pull request as ready for review
August 23, 2026 14:03
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.
What
docs.agentage.iois now served by the same landing container as the apex.packages/shared/src/origins.ts-links().docsderived from the oneSITE_FQDN(likedashboard/api):https://docs.<fqdn>in prod,http://localhost:3000/docslocally (localhost has no subdomains). NewdocsHost(fqdn)returns the dedicated hostname, orundefinedlocally.docker-compose.yml-landing-docs-httpsrouter:Host(\docs.${SITE_FQDN}`), priority 26, TLS + letsencrypt,service=landing,landing-secure-headers. Mirrors the existinglanding-apex-https/landing-www-https` labels.packages/landing/src/middleware.ts(new, first middleware in this repo) - thin adapter over the puresrc/docs/host-routing.ts:/->/docs,/<path>->/docs/<path>, never double-prefixing an already/docs*path, and passing_next/api/schemas/.well-known/health/ OG images and every dotted asset (robots.txt,sitemap.xml,*.png,*.ico) straight through..mdmirrors are treated as docs content, so/rest-api.mdstill resolves.www.): 308/docs-> docs origin/,/docs/<x>->/<x>,/docs.md->/docs.md, query string preserved.og:urlare absolute docs-origin URLs (docs/seo.ts), and the docs entries insitemap.xml,llms.txt,llms-full.txt,/docs.mdand the breadcrumb JSON-LD emit docs-origin URLs. One sitemap still lists both hosts (robots.txt cross-submission). HTML stays canonical; the.mdmirrors keepX-Robots-Tag: noindex.Nothing hardcodes
agentage.io- everything derives fromSITE_FQDN(with the build-bakedNEXT_PUBLIC_SITE_FQDNsentinel as the fallback thatdocker/runtime-env.shrewrites).Why
Docs get their own host without a second image, deploy or stack.
e2e-gate safety
deploy.yml'se2e-gateboots the image with noSITE_FQDN(entrypoint defaults it toagentage.io) and curls it onlocalhost:3100. Since the request Host is neither the apex nor the docs host, the middleware returnsnext()-/docsserves normally, no redirect, no loop. Verified by running the gate for real (below).Verification
npm run verify- green (type-check, lint, format, 59 unit tests, coverage thresholds, build).npm run test:e2e(dev server) - 36 passed.Gate simulation: standalone build (
NEXT_PUBLIC_SITE_FQDN=agentage.io) served withSITE_FQDN=agentage.ioonlocalhost:3100, thenLANDING_BASE_URL=http://localhost:3100 LANDING_EXPECTED_HOST=agentage.io npm run test:e2e- 35 passed, 1 skipped (the prod-robots skip, same as before).Curl against that same server:
Content checks:
docs.agentage.io/renders<title>Docs - Agentage Memory</title>,/rest-apirenders<title>REST API - docs - Agentage Memory</title>,/rest-api.mdreturnstext/markdownstarting# REST API. Sitemap<loc>s:https://agentage.iofor site pages,https://docs.agentage.io[/<slug>]for docs.Rollout
DNS first. This needs the
docsCNAME from the infra PR to exist before the landing deploy, otherwise Traefik cannot solve the ACME challenge fordocs.agentage.ioand the router stays certless.Order: infra DNS apply -> merge here -> landing deploy. Until then the apex
/docs*308s point at a host that does not resolve, so do not merge ahead of DNS.