Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions deploy/vercel.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,45 @@

import { VercelJsonGenerator } from "/snippets/vercel-json-generator.mdx";

## vercel.json file

Check warning on line 8 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L8

'vercel.json file' should use sentence-style capitalization.

The `vercel.json` file configures how your project is built and deployed. It sits in your project's root directory and controls various aspects of your deployment, including routing, redirects, headers, and build settings.

Check warning on line 10 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L10

In general, use active voice instead of passive voice ('is built').

We use the `rewrites` configuration to proxy requests from your main domain to your documentation.

Check warning on line 12 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L12

Try to avoid using first-person plural like 'We'.

Rewrites map incoming requests to different destinations without changing the URL in the browser. When someone visits `yoursite.com/docs`, Vercel will internally fetch content from `your-subdomain.mintlify.dev/docs` but the user will still see `yoursite.com/docs` in their browser. This is different from redirects, which would send users to a different URL entirely.

Check warning on line 14 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L14

Avoid using 'will'.

Check warning on line 14 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L14

Avoid using 'will'.

You can customize the subpath to any value you prefer, such as `/docs`, `/help`, or `/guides`. Additionally, you can use deeply nested subpaths like `/product/docs`.

## Repository structure

Your documentation files must be organized within your repository to match your chosen subpath structure. For example, if you want your documentation at `yoursite.com/docs`, you would create a `docs/` directory with all of your documentation files.

Check warning on line 20 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L20

In general, use active voice instead of passive voice ('be organized').

## Configuration

To host your documentation at a custom subpath using Vercel, add the following configuration to your `vercel.json` file. This example uses `/docs`, but you can replace it with any subpath:
1. Navigate to [Custom domain setup](https://dashboard.mintlify.com/settings/deployment/custom-domain) in your dashboard.
2. Click the **Host at `/docs`** toggle to the on position.
<Frame>
<img alt="Screenshot of the Custom domain setup page. The Host at `/docs` toggle is on and highlighted by an orange rectangle." src="/images/subpath/toggle-light.png" className="block dark:hidden" />
<img alt="Screenshot of the Custom domain setup page. The Host at `/docs` toggle is on and highlighted by an orange rectangle." src="/images/subpath/toggle-dark.png" className="hidden dark:block" />
</Frame>
3. Enter your domain.
4. Select **Add domain**.

### Host from `/docs`

To use the `/docs` subpath, add the following rewrites to your `vercel.json` file. Replace `[subdomain]` with your subdomain.

```json
{
"rewrites": [
{
"source": "/docs",
"destination": "https://[subdomain].mintlify.dev/docs"
"destination": "https://[subdomain].mintlify.dev"
},
{
"source": "/docs/:match*",
"destination": "https://[subdomain].mintlify.dev/docs/:match*"
"destination": "https://[subdomain].mintlify.dev/:match*"
}
]
}
Expand All @@ -44,9 +55,9 @@

For more information, see [Configuring projects with vercel.json: Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites) in the Vercel documentation.

### Generate rewrites
### Host from custom path

Enter your subdomain and custom subdirectory to generate the rewrites for your `vercel.json` file.
To use a custom base path (any path other than `/docs`), use the generator below to create your rewrites configuration. Add the rewrites to your `vercel.json` file.

Check warning on line 60 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L60

Use parentheses judiciously.

<VercelJsonGenerator />

Expand All @@ -54,7 +65,7 @@

If you're using an external proxy (like Cloudflare or AWS CloudFront) in front of your Vercel deployment, you must configure it properly to avoid conflicts with Vercel's domain verification and SSL certificate provisioning.

Improper proxy configuration can prevent Vercel from provisioning Let's Encrypt SSL certificates and cause domain verification failures.

Check warning on line 68 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L68

Try to avoid using first-person plural like 'Let's'.

See the [supported providers](https://vercel.com/guides/how-to-setup-verified-proxy#supported-providers-verified-proxy-lite) in the Vercel documentation.

Expand All @@ -62,7 +73,7 @@

Your external proxy must allow traffic to these specific paths without blocking, redirecting, or heavily caching:

- `/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification

Check warning on line 76 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L76

Try to avoid using first-person plural like 'Let's'.
- `/.well-known/vercel/*` - Required for Vercel domain verification
- `/mintlify-assets/_next/static/*` - Required for static assets

Expand All @@ -70,7 +81,7 @@

### Header forwarding requirements

Ensure that your proxy correctly forwards the `HOST` header. Without proper header forwarding, verification requests will fail.

Check warning on line 84 in deploy/vercel.mdx

View check run for this annotation

Mintlify / Mintlify Validation (mintlify) - vale-spellcheck

deploy/vercel.mdx#L84

Avoid using 'will'.

### Testing your proxy setup

Expand Down
Binary file added images/subpath/toggle-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/subpath/toggle-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.