Skip to main content

Host at a subpath

Host at a subpath

Serve your docs at yourdomain.com/docs instead of a subdomain — keep your marketing site and docs on one domain via a reverse proxy.

By default a custom domain is a subdomain (docs.acme.com) pointed at us with a CNAME. Subpath hosting instead serves your docs under a path of your existing site — acme.com/docs — with your own infrastructure in front. Great when you want docs and marketing under one domain for SEO and brand.

Subpath hosting has no NookDocs API and touches no DNS on our side; the customer runs a reverse proxy they control (Cloudflare Worker, Vercel middleware, or AWS CloudFront) that forwards the docs path to the project's <slug>.nookdocs.site origin. The proxy MUST send two headers: X-Nookdocs-Host (the canonical apex, e.g. acme.com, used for canonical/sitemap/OG) and X-Nookdocs-Base-Path (the path prefix, e.g. /docs, stripped for routing and re-prefixed on every emitted URL). The path is kept on the forwarded request; NookDocs strips it for routing and re-prefixes navigation, assets, sitemap.xml, llms.txt, JSON-LD, and canonical tags. Repo, content, and config are unchanged — subpath is purely a serving choice; contrast with subdomain (single CNAME, platform-provisioned cert).

How it works

You keep acme.com on your own platform and add a small reverse proxy that forwards just the docs path to NookDocs:

Visitor → acme.com/docs/guide
        → your proxy (Cloudflare / Vercel / CloudFront)
        → acme.nookdocs.site/docs/guide   (+ two headers)
        → NookDocs renders, prefixing every link/asset/canonical with /docs

The proxy tags each forwarded request with two headers we read:

HeaderValuePurpose
X-Nookdocs-Hostacme.comYour canonical domain — used for <link rel="canonical">, sitemap, OG.
X-Nookdocs-Base-Path/docsThe subpath — stripped for routing, re-prefixed on every emitted URL.

Everything the site emits — navigation, prev/next, breadcrumbs, the logo, page images, sitemap.xml, llms.txt, JSON-LD, canonical tags — is automatically prefixed with your subpath, so links stay inside acme.com/docs.

Set it up

Enable subpath on the domain

In Settings → Domains, flip Host at /docs, enter your apex (acme.com) and the path (/docs), and add it. No CNAME or certificate on our side — your proxy fronts it.

Add the reverse proxy

Copy the snippet for your platform and deploy it on your domain. Per-provider guides:

Check the headers (CSP)

If your site sends a Content-Security-Policy, make sure it doesn't block the docs assets — see CSP configuration.

The project's origin is always <your-subdomain>.nookdocs.site. The proxy forwards to it and keeps the /docs path; we strip it for routing and re-prefix it on output. Your repo, content, and config are unchanged — subpath is purely a serving choice.

Subpath vs subdomain

Subdomain — docs.acme.com

One CNAME to cname.nookdocs.site, we provision the certificate. Simplest; no proxy to maintain.

Subpath — acme.com/docs

Docs + marketing share one domain (better for brand + SEO consolidation). You run a small reverse proxy; we never touch your DNS.

Was this page helpful?

Last updated August 11, 2026