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
Copy file name to clipboardExpand all lines: advanced/subpath/route53-cloudfront.mdx
+9-6Lines changed: 9 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,9 +25,10 @@ These paths should be configured to bypass CloudFront caching and pass through d
25
25
26
26
### Header forwarding requirements
27
27
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.
29
29
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.
31
32
32
33
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.
33
34
@@ -48,7 +49,7 @@ You must include the `CloudFront-Viewer-Address` header in your origin request p
48
49
49
50
4. Select **Use: [SUBDOMAIN].mintlify.dev**.
50
51
51
-
5. For "Cache key and origin requests", select **CachingOptimized**.
52
+
5. For "Cache key and origin requests", select **CachingOptimized** for the "Cache policy".
52
53
53
54
<Frame>
54
55

@@ -100,22 +101,24 @@ Select the **Create behavior** button and create the following behaviors.
100
101
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).
102
103
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.
104
105
105
106
### `/docs/*`
106
107
107
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`).
108
109
110
+
For "Cache policy", select **CachingOptimized**. If you are using a Vercel deployment, select **VercelCloudFrontProxy** for the "Origin request policy."
111
+
109
112
<Frame>
110
113

111
114
</Frame>
112
115
113
-
For **Cache policy**, select `CachingOptimized` and create behavior.
114
-
115
116
### `/docs`
116
117
117
118
Create a behavior with a **Path pattern** of `/docs` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.
118
119
120
+
If you are using a Vercel deployment, select **VercelCloudFrontProxy** for the "Origin request policy."
121
+
119
122
<Frame>
120
123

0 commit comments