Skip to content

Commit 1795cd4

Browse files
committed
add Vercel proxy info to AWS page
1 parent 7dac172 commit 1795cd4

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

advanced/subpath/route53-cloudfront.mdx

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ description: "Host documentation at a /docs subdirectory using AWS services"
66

77
import Propagating from "/snippets/custom-subpath-propagating.mdx";
88

9+
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+
934
## Create Cloudfront Distribution
1035

1136
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,
7095
- **If a user lands on /docs**, go to `[SUBDOMAIN].mintlify.dev`
7196
- **If a user lands on any other page**, go the current landing page
7297

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.
74105

75106
### `/docs/*`
76107

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`)
78109

79110
<Frame>![Cloudfront Behavior 1](/images/cloudfront/behavior-1.png)</Frame>
80111

81112
For **Cache policy**, select `CachingOptimized` and create behavior.
82113

83114
### `/docs`
84115

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.
86117

87118
<Frame>![Cloudfront Behavior 2](/images/cloudfront/behavior-2.png)</Frame>
88119

0 commit comments

Comments
 (0)