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
+18-23Lines changed: 18 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,29 +8,23 @@ import Propagating from "/snippets/custom-subpath-propagating.mdx";
8
8
9
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
10
11
-
## Proxies with Vercel deployments
11
+
## High-level overview
12
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:
13
+
Route traffic to these paths with a Cache Policy of **CachingDisabled**:
20
14
21
15
-`/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification
22
-
-`/.well-known/vercel/*` - Required for Vercel domain verification
16
+
-`/.well-known/vercel/*` - Required for domain verification
17
+
-`/docs/*` - Required for subpath routing
18
+
-`/docs/` - Required for subpath routing
23
19
24
-
These paths should be configured to bypass CloudFront caching and pass through directly to your origin.
20
+
Route traffic to this path with a Cache Policy of **CachingEnabled**:
25
21
26
-
### Header forwarding requirements
22
+
-`/mintlify-assets/_next/static/*`
23
+
-`Default (*)` - Your websites landing page
27
24
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.
25
+
All Behaviors must have the an **origin request policy** of `AllViewerExceptHostHeader`.
29
26
30
-
1. Create a custom origin request policy named `VercelCloudFrontProxy`.
31
-
2. Include the `Origin` and `CloudFront-Viewer-Address` headers.
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.
27
+

34
28
35
29
## Create CloudFront distribution
36
30
@@ -120,12 +114,7 @@ If `.well-known/*` is too generic, it can be narrowed down to 2 behaviors at a m
120
114
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`).
121
115
122
116
- Set "Cache policy" to **CachingOptimized**.
123
-
- In "Origin request policy", create an origin request policy named **VercelCloudFrontProxy**. That forwards the `Origin` and `CloudFront-Viewer-Address` headers.
124
-
125
-
<Frame>
126
-

127
-
</Frame>
128
-
117
+
- Set "Origin request policy" to **AllViewerExceptHostHeader**.
129
118
- Set Viewer Protocol Policy to **Redirect HTTP to HTTPS**
130
119
131
120
<Frame>
@@ -139,9 +128,15 @@ Create a behavior with a **Path pattern** of `/docs/*` and **Origin and origin g
139
128
These settings should exactly match `/docs`. With the exception of the **Path pattern**.
140
129
141
130
- Set "Cache policy" to **CachingOptimized**.
142
-
- Set "Origin request policy" to **VercelCloudFrontProxy**.
131
+
- Set "Origin request policy" to **AllViewerExceptHostHeader**.
143
132
- Set "Viewer protocol policy" to **Redirect HTTP to HTTPS**
144
133
134
+
### `/mintlify-assets/_next/static/*`
135
+
136
+
- Set "Cache policy" to **CachingOptimized**
137
+
- Set "Origin request policy" to **AllViewerExceptHostHeader**
138
+
- Set "Viewer protocol policy" to **Redirect HTTP to HTTPS**
139
+
145
140
### `Default (*)`
146
141
147
142
Lastly, we're going to edit the `Default (*)` behavior.
0 commit comments