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
+60-56Lines changed: 60 additions & 56 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,71 +29,70 @@ Ensure that CloudFront forwards the `HOST` header and client IP information corr
29
29
30
30
When using CloudFront with Vercel deployments, CloudFront automatically adds the `CloudFront-Viewer-Address` header containing the original client's IP address.
31
31
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.
33
33
34
34
## Create Cloudfront distribution
35
35
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.

41
+
</Frame>
41
42
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.
5. For "Cache key and origin requests", select **CachingOptimized**.
51
52
52
-
And for **Web Application Firewall (WAF)**, enable security protections
53
+
<Frame>
54
+


72
+
</Frame>
66
73
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).
68
75
69
76
<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`.
74
78
79
+
If you use Vercel, use the `.vercel.app` domain available for every project.
75
80
</Info>
76
-
<Note>
77
81
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".
80
83
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**.

86
+
</Frame>
88
87
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.
90
89
91
90
## Set behaviors
92
91
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.
94
93
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.
97
96
98
97
Select the **Create behavior** button and create the following behaviors.
99
98
@@ -105,46 +104,49 @@ For **Cache policy**, select `CachingDisabled` to ensure these verification requ
105
104
106
105
### `/docs/*`
107
106
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`).

111
+
</Frame>
111
112
112
113
For **Cache policy**, select `CachingOptimized` and create behavior.
113
114
114
115
### `/docs`
115
116
116
117
Create a behavior with a **Path pattern** of `/docs` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.

121
+
</Frame>
119
122
120
123
### `Default (*)`
121
124
122
125
Lastly, we're going to edit the `Default (*)` behavior.

143
145
</Frame>
144
146
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.
146
148
147
-
## Connecting it with Route53
149
+
## Connect with Route53
148
150
149
151
Now, we're going to bring the functionality of the Cloudfront distribution into your primary domain.
150
152
@@ -154,24 +156,26 @@ Now, we're going to bring the functionality of the Cloudfront distribution into
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.
0 commit comments