Skip to content

Commit 6ea455d

Browse files
committed
add Vercel behavior info
1 parent 6f9f512 commit 6ea455d

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

advanced/subpath/route53-cloudfront.mdx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ These paths should be configured to bypass CloudFront caching and pass through d
2525

2626
### Header forwarding requirements
2727

28-
Ensure that CloudFront forwards the `HOST` header and client IP information correctly. This is critical for Vercel's verification processes.
28+
You must create a custom origin request policy that forwards the `HOST` header and client IP information correctly. This is critical for Vercel's verification processes.
2929

30-
When using CloudFront with Vercel deployments, CloudFront automatically adds the `CloudFront-Viewer-Address` header containing the original client's IP address.
30+
1. Create a custom origin request policy named `VercelCloudFrontProxy`.
31+
2. Include the `Origin` and `CloudFront-Viewer-Address` headers.
3132

3233
You must include the `CloudFront-Viewer-Address` header in your origin request policy or cache policy headers configuration to forward the header to your origin.
3334

@@ -48,7 +49,7 @@ You must include the `CloudFront-Viewer-Address` header in your origin request p
4849

4950
4. Select **Use: [SUBDOMAIN].mintlify.dev**.
5051

51-
5. For "Cache key and origin requests", select **CachingOptimized**.
52+
5. For "Cache key and origin requests", select **CachingOptimized** for the "Cache policy".
5253

5354
<Frame>
5455
![Cloudfront "Create distribution" page showing "CachingOptimized" selected for the cache key and origin requests policy.](/images/cloudfront/caching-policy.png)
@@ -100,22 +101,24 @@ Select the **Create behavior** button and create the following behaviors.
100101

101102
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).
102103

103-
For **Cache policy**, select `CachingDisabled` to ensure these verification requests pass through without caching.
104+
For "Cache policy", select **CachingDisabled** to ensure these verification requests pass through without caching.
104105

105106
### `/docs/*`
106107

107108
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`).
108109

110+
For "Cache policy", select **CachingOptimized**. If you are using a Vercel deployment, select **VercelCloudFrontProxy** for the "Origin request policy."
111+
109112
<Frame>
110113
![Cloudfront "Create behavior" page with a "Path pattern" of "/docs/*" and "Origin and origin groups" pointing to the `acme.mintlify.dev` URL.](/images/cloudfront/behavior-1.png)
111114
</Frame>
112115

113-
For **Cache policy**, select `CachingOptimized` and create behavior.
114-
115116
### `/docs`
116117

117118
Create a behavior with a **Path pattern** of `/docs` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.
118119

120+
If you are using a Vercel deployment, select **VercelCloudFrontProxy** for the "Origin request policy."
121+
119122
<Frame>
120123
![Cloudfront "Create behavior" page with a "Path pattern" of "/docs" and "Origin and origin groups" pointing to the `acme.mintlify.dev` URL.](/images/cloudfront/behavior-2.png)
121124
</Frame>

0 commit comments

Comments
 (0)