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
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.
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
11
## Proxies with Vercel deployments
12
12
@@ -25,153 +25,187 @@ These paths should be configured to bypass CloudFront caching and pass through d
25
25
26
26
### Header forwarding requirements
27
27
28
-
Ensure that CloudFront forwards the `HOST` header and client IP information correctly. This is critical for Vercel's verification processes.
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.
29
29
30
-
When using CloudFront with Vercel deployments, CloudFront automatically adds the `CloudFront-Viewer-Address` header containing the original client's IP address.
30
+
1. Create a custom origin request policy named `VercelCloudFrontProxy`.
31
+
2. Include the `Origin` and `CloudFront-Viewer-Address` headers.
31
32
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.
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.
33
34
34
-
## Create Cloudfront Distribution
35
+
## Create CloudFront distribution
35
36
36
-
Navigate to [Cloudfront](https://aws.amazon.com/cloudfront) inside the AWS console and click on `Create distribution`
37
+
1. Navigate to [CloudFront](https://aws.amazon.com/cloudfront) inside the AWS console.

42
+
</Frame>
41
43
42
-
For the Origin domain, input `[SUBDOMAIN].mintlify.dev` where `[SUBDOMAIN]` is the project's unique subdomain. Click on `Use: [SUBDOMAIN].mintlify.dev`
44
+
3.For the Origin domain, input `[SUBDOMAIN].mintlify.dev` where `[SUBDOMAIN]` is your project's unique subdomain.
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.
67
+
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
68
69
69
<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.
70
+
If your landing page is hosted on Webflow, use Webflow's staging URL. It would look like `.webflow.io`.
74
71
72
+
If you use Vercel, use the `.vercel.app` domain available for every project.
75
73
</Info>
76
-
<Note>
77
74
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
75
+
3. Create a new Origin and add your staging URL as the "Origin domain".
80
76
81
-
</Note>
77
+
<Frame>
78
+

79
+
</Frame>
82
80
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**.
81
+
By this point, you should have two Origins: one with `[SUBDOMAIN].mintlify.app`and another with your staging URL.
Select the **Create behavior** button and create the following behaviors.
100
+
2.Select the **Create behavior** button and create the following behaviors.
99
101
100
102
### `/.well-known/*`
101
103
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/*` and set **Origin and origin groups** to your docs URL.
103
105
104
-
For **Cache policy**, select `CachingDisabled` to ensure these verification requests pass through without caching.
106
+
For "Cache policy", select **CachingDisabled** to ensure these verification requests pass through without caching.
105
107
106
-
### `/docs/*`
108
+
<Frame>
109
+

110
+
</Frame>
111
+
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>
107
117
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`)
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
121
112
-
For **Cache policy**, select `CachingOptimized` and create behavior.
122
+
- 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.
113
124
114
-
### `/docs`
125
+
<Frame>
126
+

127
+
</Frame>
128
+
129
+
- Set Viewer Protocol Policy to **Redirect HTTP to HTTPS**
130
+
131
+
<Frame>
132
+

133
+
</Frame>
134
+
135
+
### `/docs/*`
115
136
116
-
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.

143
175
</Frame>
144
176
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.
177
+
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
178
147
-
## Connecting it with Route53
179
+
## Connect with Route53
148
180
149
-
Now, we're going to bring the functionality of the Cloudfront distribution into your primary domain.
181
+
Now, we're going to bring the functionality of the CloudFront distribution into your primary domain.
150
182
151
183
<Note>
152
184
For this section, you can also refer to AWS's official guide on [Configuring
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`
189
+
1. Navigate to [Route53](https://aws.amazon.com/route53) inside the AWS console.
190
+
2. Navigate to the "Hosted zone" for your primary domain.
0 commit comments