Skip to content

Commit d54c730

Browse files
committed
docs: updated screenshots with new Cloudfront webpages
1 parent 6ea455d commit d54c730

File tree

8 files changed

+49
-22
lines changed

8 files changed

+49
-22
lines changed

advanced/subpath/route53-cloudfront.mdx

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,14 @@ You must include the `CloudFront-Viewer-Address` header in your origin request p
4747
![Cloudfront "Create distribution" page showing "acme.mintlify.dev" as the origin domain.](/images/cloudfront/origin-name.png)
4848
</Frame>
4949

50-
4. Select **Use: [SUBDOMAIN].mintlify.dev**.
51-
52-
5. For "Cache key and origin requests", select **CachingOptimized** for the "Cache policy".
53-
54-
<Frame>
55-
![Cloudfront "Create distribution" page showing "CachingOptimized" selected for the cache key and origin requests policy.](/images/cloudfront/caching-policy.png)
56-
</Frame>
57-
58-
6. For "Web Application Firewall (WAF)," enable security protections.
50+
4. For "Web Application Firewall (WAF)," enable security protections.
5951

6052
<Frame>
6153
![Web Application Firewall (WAF) options with "Enable security protections" selected.](/images/cloudfront/enable-security-protections.png)
6254
</Frame>
6355

64-
7. The remaining settings should be default.
65-
8. Select **Create distribution**.
56+
5. The remaining settings should be default.
57+
6. Select **Create distribution**.
6658

6759
## Add default origin
6860

@@ -86,7 +78,11 @@ You must include the `CloudFront-Viewer-Address` header in your origin request p
8678
![Cloudfront "Create origin" page with a "Origin domain" input field highlighted.](/images/cloudfront/default-origin.png)
8779
</Frame>
8880

89-
By this point, you should have two Origins: one with `[SUBDOMAIN].mintlify.app` and another with with staging URL.
81+
By this point, you should have two Origins: one with `[SUBDOMAIN].mintlify.app` and another with your staging URL.
82+
83+
<Frame>
84+
![Cloudfront "Origins" page with two origins: One for `mintlify` and another for `mintlify-landing-page`.](/images/cloudfront/final-origins.png)
85+
</Frame>
9086

9187
## Set behaviors
9288

@@ -95,33 +91,56 @@ Behaviors in Cloudfront enable control over the subpath logic. At a high level,
9591
- **If a user lands on /docs**, go to `[SUBDOMAIN].mintlify.dev`.
9692
- **If a user lands on any other page**, go the current landing page.
9793

94+
Navigate to the "Behaviors" tab of your Cloudfront distribution.
95+
96+
<Frame>
97+
![Cloudfront "Behaviors" tab highlighted.](/images/cloudfront/behaviors.png)
98+
</Frame>
99+
98100
Select the **Create behavior** button and create the following behaviors.
99101

100102
### `/.well-known/*`
101103

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).
104+
Create behaviors for Vercel domain verification paths with a **Path pattern** of `/.well-known/*` set **Origin and origin groups** to your docs URL.
103105

104106
For "Cache policy", select **CachingDisabled** to ensure these verification requests pass through without caching.
105107

106-
### `/docs/*`
108+
<Frame>
109+
![Cloudfront "Create behavior" page with a "Path pattern" of "/.well-known/*" and "Origin and origin groups" pointing to the staging URL.](/images/cloudfront/well-known-policy.png)
110+
</Frame>
107111

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`).
112+
<Info>
113+
If `.well-known/*` is too generic, it can be narrowed down to 2 behaviors at a minimum for Vercel:
114+
- `/.well-known/vercel/*` - Required for Vercel domain verification
115+
- `/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification
116+
</Info>
109117

110-
For "Cache policy", select **CachingOptimized**. If you are using a Vercel deployment, select **VercelCloudFrontProxy** for the "Origin request policy."
118+
### `/docs`
119+
120+
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+
122+
- Set "Cache policy" to **CachingOptimized**.
123+
- In "Origin request policy". Create an origin request policy named **VercelCloudFrontProxy**. That forward 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+
129+
- Set Viewer Protocol Policy to **Redirect HTTP to HTTPS**
111130

112131
<Frame>
113132
![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)
114133
</Frame>
115134

116-
### `/docs`
135+
### `/docs/*`
117136

118-
Create a behavior with a **Path pattern** of `/docs` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.
137+
Create a behavior with a **Path pattern** of `/docs/*` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.
119138

120-
If you are using a Vercel deployment, select **VercelCloudFrontProxy** for the "Origin request policy."
139+
These settings should exactly match `/docs`. With the exception of the **Path pattern**.
121140

122-
<Frame>
123-
![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)
124-
</Frame>
141+
- Set "Cache policy" to **CachingOptimized**.
142+
- Set Origin request policy to **VercelCloudFrontProxy**.
143+
- Set Viewer Protocol Policy to **Redirect HTTP to HTTPS**
125144

126145
### `Default (*)`
127146

@@ -139,6 +158,14 @@ Lastly, we're going to edit the `Default (*)` behavior.
139158

140159
2. Select **Save changes**.
141160

161+
### Check Behaviors are set up correctly
162+
163+
If you follow the above steps, your behaviors should look like this:
164+
165+
<Frame>
166+
![Cloudfront "Behaviors" page with 4 behaviors: `/docs/*`, `/docs`, `Default`, and `/.well-known/*`.](/images/cloudfront/all-behaviors.png)
167+
</Frame>
168+
142169
## Preview distribution
143170

144171
You can now test if your distribution is set up properly by going to the "General" tab and visiting the **Distribution domain name** URL.
56.8 KB
Loading

images/cloudfront/behavior-1.png

-79.3 KB
Loading
-169 KB
Loading
69 KB
Loading

images/cloudfront/origin-name.png

-103 KB
Loading
69.2 KB
Loading
108 KB
Loading

0 commit comments

Comments
 (0)