Skip to content

Commit 6f9f512

Browse files
committed
copy edit
1 parent af784f2 commit 6f9f512

File tree

1 file changed

+60
-56
lines changed

1 file changed

+60
-56
lines changed

advanced/subpath/route53-cloudfront.mdx

Lines changed: 60 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -29,71 +29,70 @@ Ensure that CloudFront forwards the `HOST` header and client IP information corr
2929

3030
When using CloudFront with Vercel deployments, CloudFront automatically adds the `CloudFront-Viewer-Address` header containing the original client's IP address.
3131

32-
Make sure your CloudFront distribution is configured to forward this header to your origin by including it in your origin request policy or cache policy headers configuration.
32+
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.
3333

3434
## Create Cloudfront distribution
3535

36-
Navigate to [Cloudfront](https://aws.amazon.com/cloudfront) inside the AWS console and click on `Create distribution`
36+
1. Navigate to [Cloudfront](https://aws.amazon.com/cloudfront) inside the AWS console.
37+
2. Select **Create distribution**.
3738

38-
<Frame>
39-
![Cloudfront Create Distribution](/images/cloudfront/create-distribution.png)
40-
</Frame>
39+
<Frame>
40+
![Cloudfront Distributions page with the "Create distribution" button emphasized.](/images/cloudfront/create-distribution.png)
41+
</Frame>
4142

42-
For the Origin domain, input `[SUBDOMAIN].mintlify.dev` where `[SUBDOMAIN]` is the project's unique subdomain. Click on `Use: [SUBDOMAIN].mintlify.dev`
43+
3. For the Origin domain, input `[SUBDOMAIN].mintlify.dev` where `[SUBDOMAIN]` is your project's unique subdomain.
4344

44-
<Frame>![Cloudfront Origin name](/images/cloudfront/origin-name.png)</Frame>
45+
<Frame>
46+
![Cloudfront "Create distribution" page showing "acme.mintlify.dev" as the origin domain.](/images/cloudfront/origin-name.png)
47+
</Frame>
4548

46-
For **Cache key and origin requests**, select `Caching Optimized`.
49+
4. Select **Use: [SUBDOMAIN].mintlify.dev**.
4750

48-
<Frame>
49-
![Cloudfront Caching policy](/images/cloudfront/caching-policy.png)
50-
</Frame>
51+
5. For "Cache key and origin requests", select **CachingOptimized**.
5152

52-
And for **Web Application Firewall (WAF)**, enable security protections
53+
<Frame>
54+
![Cloudfront "Create distribution" page showing "CachingOptimized" selected for the cache key and origin requests policy.](/images/cloudfront/caching-policy.png)
55+
</Frame>
5356

54-
<Frame>
55-
![Cloudfront Caching
56-
policy](/images/cloudfront/enable-security-protections.png)
57-
</Frame>
57+
6. For "Web Application Firewall (WAF)," enable security protections.
58+
59+
<Frame>
60+
![Web Application Firewall (WAF) options with "Enable security protections" selected.](/images/cloudfront/enable-security-protections.png)
61+
</Frame>
5862

59-
The remaining settings should be default. Click `Create distribution`.
63+
7. The remaining settings should be default.
64+
8. Select **Create distribution**.
6065

6166
## Add default origin
6267

63-
After creating the distribution, navigate to the `Origins` tab.
68+
1. After creating the distribution, navigate to the "Origins" tab.
6469

65-
<Frame>![Cloudfront Origins](/images/cloudfront/origins.png)</Frame>
70+
<Frame>
71+
![A Cloudfront distribution with the "Origins" tab highlighted.](/images/cloudfront/origins.png)
72+
</Frame>
6673

67-
We want to find a staging URL that mirrors where the main domain (example.com). This is highly variant depending on how your landing page is hosted.
74+
2. Find your staging URL that mirrors the main domain. This is highly variant depending on how your landing page is hosted. For example, the Mintlify staging URL is [mintlify-landing-page.vercel.app](https://mintlify-landing-page.vercel.app).
6875

6976
<Info>
70-
For instance, if your landing page is hosted on Webflow, you can use the
71-
Webflow's staging URL. It would look like `.webflow.io`.
72-
73-
If you use Vercel, you use the `.vercel.app` domain available for every project.
77+
If your landing page is hosted on Webflow, use Webflow's staging URL. It would look like `.webflow.io`.
7478

79+
If you use Vercel, use the `.vercel.app` domain available for every project.
7580
</Info>
76-
<Note>
7781

78-
If you're unsure on how to get a staging URL for your landing page, [contact
79-
support](/contact-support) and we'd be happy to help
82+
3. Create a new Origin and add your staging URL as the "Origin domain".
8083

81-
</Note>
82-
83-
Once you have the staging URL, ours for instance is [mintlify-landing-page.vercel.app](https://mintlify-landing-page.vercel.app), create a new Origin and add it as the **Origin domain**.
84-
85-
<Frame>
86-
![Cloudfront Default Origins](/images/cloudfront/default-origin.png)
87-
</Frame>
84+
<Frame>
85+
![Cloudfront "Create origin" page with a "Origin domain" input field highlighted.](/images/cloudfront/default-origin.png)
86+
</Frame>
8887

89-
By this point, you should have two Origins - one with `[SUBDOMAIN].mintlify.app` and another with with staging URL.
88+
By this point, you should have two Origins: one with `[SUBDOMAIN].mintlify.app` and another with with staging URL.
9089

9190
## Set behaviors
9291

93-
Behaviors in Cloudfront enables control over the subpath logic. At a high level, we're looking to create the following logic.
92+
Behaviors in Cloudfront enable control over the subpath logic. At a high level, we're looking to create the following logic.
9493

95-
- **If a user lands on /docs**, go to `[SUBDOMAIN].mintlify.dev`
96-
- **If a user lands on any other page**, go the current landing page
94+
- **If a user lands on /docs**, go to `[SUBDOMAIN].mintlify.dev`.
95+
- **If a user lands on any other page**, go the current landing page.
9796

9897
Select the **Create behavior** button and create the following behaviors.
9998

@@ -105,46 +104,49 @@ For **Cache policy**, select `CachingDisabled` to ensure these verification requ
105104

106105
### `/docs/*`
107106

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`)
107+
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`).
109108

110-
<Frame>![Cloudfront Behavior 1](/images/cloudfront/behavior-1.png)</Frame>
109+
<Frame>
110+
![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)
111+
</Frame>
111112

112113
For **Cache policy**, select `CachingOptimized` and create behavior.
113114

114115
### `/docs`
115116

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

118-
<Frame>![Cloudfront Behavior 2](/images/cloudfront/behavior-2.png)</Frame>
119+
<Frame>
120+
![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)
121+
</Frame>
119122

120123
### `Default (*)`
121124

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

124127
<Frame>
125-
![Cloudfront Behavior Default 1](/images/cloudfront/default-behavior-1.png)
128+
![A Cloudfront distribution with the "Default (*)" behavior selected and the Edit button emphasized.](/images/cloudfront/default-behavior-1.png)
126129
</Frame>
127130

128-
We're going to change the default behavior's **Origin and origin groups** to the staging URL (in our case `mintlify-landing-page.vercel.app`).
131+
1. Change the default behavior's **Origin and origin groups** to the staging URL (in our case `mintlify-landing-page.vercel.app`).
129132

130133
<Frame>
131-
![Cloudfront Behavior Default 2](/images/cloudfront/default-behavior-2.png)
134+
![Cloudfront "Edit behavior" page with the "Origin and origin groups" input field highlighted.](/images/cloudfront/default-behavior-2.png)
132135
</Frame>
133136

134-
Click on `Save changes`.
137+
2. Select **Save changes**.
135138

136139
## Preview distribution
137140

138-
You can now test if your distribution is set up properly by going to the `General` tab and visiting the **Distribution domain name** URL.
141+
You can now test if your distribution is set up properly by going to the "General" tab and visiting the **Distribution domain name** URL.
139142

140143
<Frame>
141-
![Cloudfront Preview
142-
distribution](/images/cloudfront/preview-distribution.png)
144+
![Cloudfront "General" tab with the "Distribution domain name" URL highlighted.](/images/cloudfront/preview-distribution.png)
143145
</Frame>
144146

145-
All pages should be directing to your main landing page, but if you append `/docs` to the URL, you should see it going to the Mintlify documentation instance.
147+
All pages should be directing to your main landing page, but if you append `/docs` to the URL, you should see it going to your Mintlify documentation instance.
146148

147-
## Connecting it with Route53
149+
## Connect with Route53
148150

149151
Now, we're going to bring the functionality of the Cloudfront distribution into your primary domain.
150152

@@ -154,24 +156,26 @@ Now, we're going to bring the functionality of the Cloudfront distribution into
154156
distribution](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/routing-to-cloudfront-distribution.html#routing-to-cloudfront-distribution-config)
155157
</Note>
156158

157-
Navigate to [Route53](https://aws.amazon.com/route53) inside the AWS console, and click into the `Hosted zone` for your primary domain. Click on `Create record`
159+
1. Navigate to [Route53](https://aws.amazon.com/route53) inside the AWS console.
160+
2. Navigate to the "Hosted zone" for your primary domain.
161+
3. Select **Create record**.
158162

159163
<Frame>
160-
![Route 53 create record](/images/cloudfront/route53-create-record.png)
164+
![Route 53 "Records" page with the "Create record" button emphasized.](/images/cloudfront/route53-create-record.png)
161165
</Frame>
162166

163-
Toggle `Alias` and then **Route traffic to** the `Alias to CloudFront distribution` option.
167+
4. Toggle `Alias` and then **Route traffic to** the `Alias to CloudFront distribution` option.
164168

165169
<Frame>
166-
![Route 53 create record alias](/images/cloudfront/create-record-alias.png)
170+
![Route 53 "Create record" page with the "Alias" toggle and the "Route traffic to" menu highlighted.](/images/cloudfront/create-record-alias.png)
167171
</Frame>
168172

169-
Click `Create records`.
173+
5. Select **Create records**.
170174

171175
<Note>
172176
You may need to remove the existing A record if one currently exists.
173177
</Note>
174178

175-
And voila! Your documentation will be served at `/docs` for your primary domain.
179+
Your documentation is now live at `/docs` for your primary domain.
176180

177181
<Propagating />

0 commit comments

Comments
 (0)