Skip to content

Commit 63488dc

Browse files
committed
update Vercel page
1 parent 1795cd4 commit 63488dc

File tree

1 file changed

+45
-8
lines changed

1 file changed

+45
-8
lines changed

advanced/subpath/vercel.mdx

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ title: "Vercel"
33
description: "Host documentation at a /docs subpath using Vercel"
44
---
55

6-
## vercel.json Configuration
6+
## vercel.json file
77

8-
To host your documentation at a custom subpath using Vercel, you need to add the
9-
following configuration to your `vercel.json` file.
8+
The `vercel.json` file is Vercel's configuration file that allows you to customize 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.
9+
10+
We use the `rewrites` configuration to proxy requests from your main domain to your documentation.
11+
12+
Rewrites allow you to 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.
13+
14+
## Configuration
15+
16+
To host your documentation at a custom `/docs` subpath using Vercel, add the following configuration to your `vercel.json` file:
1017

1118
```json
1219
{
@@ -23,8 +30,38 @@ following configuration to your `vercel.json` file.
2330
}
2431
```
2532

26-
<Note>
27-
For more information, you can also refer to Vercel's offical guide on
28-
rewrites: [Project Configuration:
29-
Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites)
30-
</Note>
33+
- **`source`**: The path pattern on your domain that triggers the rewrite.
34+
- **`destination`**: Where the request should be proxied to.
35+
- **`:match*`**: A wildcard that captures any path segments after `/docs/`.
36+
37+
38+
For more information, see [Configuring projects with vercel.json: Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites) in the Vercel documentation.
39+
40+
## Using external proxies with Vercel
41+
42+
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.
43+
44+
Improper proxy configuration can prevent Vercel from provisioning Let's Encrypt SSL certificates and cause domain verification failures.
45+
46+
See the [supported providers](https://vercel.com/guides/how-to-setup-verified-proxy#supported-providers-verified-proxy-lite) in the Vercel documentation.
47+
48+
### Required path allowlist
49+
50+
Your external proxy must allow traffic to these specific paths without blocking, redirecting, or heavily caching:
51+
52+
- `/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification
53+
- `/.well-known/vercel/*` - Required for Vercel domain verification
54+
55+
These paths should pass through directly to your Vercel deployment without modification.
56+
57+
### Header forwarding requirements
58+
59+
Ensure that your proxy correctly forwards the `HOST` header. Without proper header forwarding, verification requests will fail.
60+
61+
### Testing your proxy setup
62+
63+
To verify your proxy is correctly configured:
64+
65+
1. Test that `https://[yourdomain].com/.well-known/vercel/` returns a response.
66+
2. Ensure SSL certificates are provisioning correctly in your Vercel dashboard.
67+
3. Check that domain verification completes successfully.

0 commit comments

Comments
 (0)