You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To host your documentation at a `/docs` subpath using AWS Route 53 and Cloudfront, you need to configure your DNS provider to point to your Cloudfront distribution.
10
+
11
+
## Proxies with Vercel deployments
12
+
13
+
If you use AWS CloudFront as a proxy with Vercel deployments, you must configure CloudFront to avoid interfering with Vercel's domain verification and SSL certificate provisioning.
14
+
15
+
Improper CloudFront configuration can prevent Vercel from provisioning Let's Encrypt SSL certificates and cause domain verification failures.
16
+
17
+
### Required path allowlist
18
+
19
+
CloudFront must allow traffic to these specific paths without caching or blocking:
20
+
21
+
-`/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification
22
+
-`/.well-known/vercel/*` - Required for Vercel domain verification
23
+
24
+
These paths should be configured to bypass CloudFront caching and pass through directly to your origin.
25
+
26
+
### Header forwarding requirements
27
+
28
+
Ensure that CloudFront forwards the `HOST` header and client IP information correctly. This is critical for Vercel's verification processes.
29
+
30
+
When using CloudFront with Vercel deployments, CloudFront automatically adds the `CloudFront-Viewer-Address` header containing the original client's IP address.
31
+
32
+
Make sure your CloudFront distribution is configured to forward this header to your origin by including it in your origin request policy or cache policy headers configuration.
33
+
9
34
## Create Cloudfront Distribution
10
35
11
36
Navigate to [Cloudfront](https://aws.amazon.com/cloudfront) inside the AWS console and click on `Create distribution`
@@ -70,19 +95,25 @@ Behaviors in Cloudfront enables control over the subpath logic. At a high level,
70
95
-**If a user lands on /docs**, go to `[SUBDOMAIN].mintlify.dev`
71
96
-**If a user lands on any other page**, go the current landing page
72
97
73
-
We're going to create three behaviors by clicking on the `Create behavior` button.
98
+
Select the **Create behavior** button and create the following behaviors.
99
+
100
+
### `/.well-known/*`
101
+
102
+
If you are deploying to Vercel, create a behavior for Vercel verification paths with a **Path pattern** of `/.well-known/*` and **Origin and origin groups** pointing to your main origin (the staging URL).
103
+
104
+
For **Cache policy**, select `CachingDisabled` to ensure these verification requests pass through without caching.
74
105
75
106
### `/docs/*`
76
107
77
-
The first behavior should have a **Path pattern** of `/docs/*` with **Origin and origin groups** pointing to the `.mintlify.dev` URL (in our case `acme.mintlify.dev`)
108
+
Create a behavior with a **Path pattern** of `/docs/*` with **Origin and origin groups** pointing to the `.mintlify.dev` URL (in our case `acme.mintlify.dev`)
For **Cache policy**, select `CachingOptimized` and create behavior.
82
113
83
114
### `/docs`
84
115
85
-
The second behavior should be the same as the first one but with a **Path pattern** of `/docs` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.
116
+
Create a behavior with a **Path pattern** of `/docs` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.
0 commit comments