Files
mintlify__docs/snippets/vercel-json-generator.mdx
Ethan Palm be7a1371ac Custom domain updates (#6465)
* docs: update custom domain setup for new dashboard flow

Reflect the new custom domain UI: hosting mode selector (domain/subdomain
vs subpath), traffic routing options (Mintlify-managed vs proxy-only),
arbitrary base paths with reserved-path list, and base path changes that
redeploy with rollback on failure. Replace references to the removed
Host at /docs toggle in the Vercel and reverse proxy guides.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* copy edit

* update images

* docs: update subpath proxy guides for dashboard base paths

Custom subpaths no longer require documentation files to live in a
directory matching the subpath. The base path set in the dashboard is
applied at build time, so the custom subpath reverse proxy setup now
uses the same routing configuration as /docs with the path substituted.
Add dashboard base path setup steps to the Vercel, Cloudflare Worker,
and Route 53/CloudFront guides.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* 💅

* add plan gate

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* update vercel generator

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* remove gate

* remove gate

* Fix review findings: shared subpath setup snippet, generalize /docs framing, clarify Host header and script guidance

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Align hosting mode and traffic routing labels with dashboard UI, update screenshot alt text

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Fix root-only special file routing: path-preserving nginx destinations, restore sitemap/robots/mcp rewrites, sanitize generator input

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Add apex domain DNS provider requirements

Apex domains get the same CNAME instruction as subdomains, but a CNAME
at the apex requires provider support for CNAME flattening or ALIAS
records. Document the requirement and supported providers, and link to
it from the hosting mode section.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* Correct special-file routing to base-path destinations per live verification, remove stale toggle images, generalize propagation snippet

Verified against mintlify.mintlify.site: all special files (sitemap.xml,
robots.txt, mcp, skill.md, llms.txt) serve under the base path and 404 at
root, so root-mapping rewrites are reverted and optional root routes now
proxy to base-path destinations. Broken links in es/fr/zh from image
deletion resolve via post-merge translation automation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* remove outdated images

* Update dashboard instructions for Host at toggle UI (mint #8979)

The hosting mode selector and traffic routing options were replaced with
a Host at toggle and inline base path input; routing is now inferred from
DNS. Verified against mint origin/main commit 6fb20b1789.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

* 💅

---------

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-09 18:04:01 -07:00

91 lines
3.6 KiB
Plaintext

export const VercelJsonGenerator = () => {
const [subdomain, setSubdomain] = useState('[SUBDOMAIN]')
const [subpath, setSubpath] = useState('[SUBPATH]')
const cleanSubpath = subpath.trim().replace(/^\/+|\/+$/g, '') || '[SUBPATH]'
const vercelConfig = {
rewrites: [
{
source: "/_mintlify/:path*",
destination: `https://${subdomain}.mintlify.site/_mintlify/:path*`
},
{
source: "/api/request",
destination: `https://${subdomain}.mintlify.site/_mintlify/api/request`
},
{
source: `/${cleanSubpath}`,
destination: `https://${subdomain}.mintlify.site/${cleanSubpath}`
},
{
source: `/${cleanSubpath}/:path*`,
destination: `https://${subdomain}.mintlify.site/${cleanSubpath}/:path*`
},
{
source: "/mintlify-assets/:path+",
destination: `https://${subdomain}.mintlify.site/mintlify-assets/:path+`
}
]
}
const copyToClipboard = () => {
navigator.clipboard
.writeText(JSON.stringify(vercelConfig, null, 2))
.then(() => {
console.log('Copied config to clipboard!')
})
.catch((err) => {
console.error("Failed to copy: ", err)
})
}
return (
<div className="p-4 border dark:border-white/10 rounded-2xl not-prose space-y-4">
<div className="space-y-4">
<div>
<label className="block text-sm text-zinc-950/70 dark:text-white/70 mb-1">
Subdomain
</label>
<input
type="text"
value={subdomain}
onChange={(e) => setSubdomain(e.target.value)}
placeholder="your-subdomain"
className="w-full p-1 text-sm rounded border dark:border-white/10 bg-transparent"
/>
</div>
<div>
<label className="block text-sm text-zinc-950/70 dark:text-white/70 mb-1">
Subpath
</label>
<input
type="text"
value={subpath}
onChange={(e) => setSubpath(e.target.value)}
placeholder="docs"
className="w-full p-1 text-sm rounded border dark:border-white/10 bg-transparent"
/>
</div>
</div>
<div className="relative">
<button
onClick={copyToClipboard}
className="absolute top-2 right-2 p-2 rounded-lg transition-all duration-200 group"
>
<svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg" className="w-4 h-4 dark:text-white/60 text-gray-400 group-hover:text-gray-500 dark:group-hover:text-white/60 transition-colors">
<path d="M14.25 5.25H7.25C6.14543 5.25 5.25 6.14543 5.25 7.25V14.25C5.25 15.3546 6.14543 16.25 7.25 16.25H14.25C15.3546 16.25 16.25 15.3546 16.25 14.25V7.25C16.25 6.14543 15.3546 5.25 14.25 5.25Z" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
<path d="M2.80103 11.998L1.77203 5.07397C1.61003 3.98097 2.36403 2.96397 3.45603 2.80197L10.38 1.77297C11.313 1.63397 12.19 2.16297 12.528 3.00097" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
</svg>
<span className="absolute top-9 left-1/2 transform -translate-x-1/2 bg-primary text-white text-xs px-1.5 py-0.5 rounded-lg opacity-0 group-hover:opacity-100 transition-opacity duration-200 whitespace-nowrap">
Copy
</span>
</button>
<pre className="p-4 rounded-lg overflow-auto text-xs border dark:border-white/10">
<code>{JSON.stringify(vercelConfig, null, 2)}</code>
</pre>
</div>
</div>
)
}