Skip to content

Commit b786623

Browse files
Cleaned up CloudFront Documentation, and added a HighLevel overview (#1110)
* Update advanced/subpath/route53-cloudfront.mdx * feature: formatting, updated screrenshot * remove extra details about Custom OriginRequest policy * feature: updated top redirect rules * feature: polished up the highlevel overview document --------- Co-authored-by: mintlify[bot] <109931778+mintlify[bot]@users.noreply.github.com> Co-authored-by: cdxker <[email protected]>
1 parent d5f4b8e commit b786623

File tree

4 files changed

+19
-23
lines changed

4 files changed

+19
-23
lines changed

advanced/subpath/route53-cloudfront.mdx

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,23 @@ import Propagating from "/snippets/custom-subpath-propagating.mdx";
88

99
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.
1010

11-
## Proxies with Vercel deployments
11+
## High-level overview
1212

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**:
2014

2115
- `/.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
2319

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**:
2521

26-
### Header forwarding requirements
22+
- `/mintlify-assets/_next/static/*`
23+
- `Default (*)` - Your websites landing page
2724

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`.
2926

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+
![CloudFront "Behaviors" page with 4 behaviors: `/docs/*`, `/docs`, `Default`, and `/.well-known/*`.](/images/cloudfront/all-behaviors.png)
3428

3529
## Create CloudFront distribution
3630

@@ -120,12 +114,7 @@ If `.well-known/*` is too generic, it can be narrowed down to 2 behaviors at a m
120114
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`).
121115

122116
- 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-
![CloudFront Create origin request policy page that forwards the `Origin` and `CloudFront-Viewer-Address` headers](/images/cloudfront/origin-request-policy.png)
127-
</Frame>
128-
117+
- Set "Origin request policy" to **AllViewerExceptHostHeader**.
129118
- Set Viewer Protocol Policy to **Redirect HTTP to HTTPS**
130119

131120
<Frame>
@@ -139,9 +128,15 @@ Create a behavior with a **Path pattern** of `/docs/*` and **Origin and origin g
139128
These settings should exactly match `/docs`. With the exception of the **Path pattern**.
140129

141130
- Set "Cache policy" to **CachingOptimized**.
142-
- Set "Origin request policy" to **VercelCloudFrontProxy**.
131+
- Set "Origin request policy" to **AllViewerExceptHostHeader**.
143132
- Set "Viewer protocol policy" to **Redirect HTTP to HTTPS**
144133

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+
145140
### `Default (*)`
146141

147142
Lastly, we're going to edit the `Default (*)` behavior.

advanced/subpath/vercel.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Your external proxy must allow traffic to these specific paths without blocking,
5151

5252
- `/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification
5353
- `/.well-known/vercel/*` - Required for Vercel domain verification
54+
- `/mintlify-assets/_next/static/*` - Required for static assets
5455

5556
These paths should pass through directly to your Vercel deployment without modification.
5657

20.8 KB
Loading

images/cloudfront/behavior-1.png

14.8 KB
Loading

0 commit comments

Comments
 (0)