Skip to content

Commit 095bec3

Browse files
committed
Merge branch 'main' into x-mint
2 parents be7ae75 + af47b10 commit 095bec3

File tree

6 files changed

+221
-64
lines changed

6 files changed

+221
-64
lines changed

advanced/subpath/cloudflare.mdx

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,25 @@ Create a Cloudflare Worker by following the [Cloudflare Workers getting started
1919
If your DNS provider is Cloudflare, do not use proxying for the CNAME record.
2020
</Warning>
2121

22+
### Proxies with Vercel deployments
23+
24+
If you use Cloudflare as a proxy with Vercel deployments, you must ensure proper configuration to avoid conflicts with Vercel's domain verification and SSL certificate provisioning.
25+
26+
Improper proxy configuration can prevent Vercel from provisioning Let's Encrypt SSL certificates and cause domain verification failures.
27+
28+
#### Required path allowlist
29+
30+
Your Cloudflare Worker must allow traffic to these specific paths without blocking or redirecting:
31+
32+
- `/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification
33+
- `/.well-known/vercel/*` - Required for Vercel domain verification
34+
35+
While Cloudflare automatically handles many verification rules, creating additional custom rules may inadvertently block this critical traffic.
36+
37+
#### Header forwarding requirements
38+
39+
Ensure that the `HOST` header is correctly forwarded in your Worker configuration. Failure to properly forward headers will cause verification requests to fail.
40+
2241
### Configure routing
2342

2443
In your Cloudflare dashboard, select **Edit Code** and add the following script into your Worker's code. See the [Cloudflare documentation](https://developers.cloudflare.com/workers-ai/get-started/dashboard/#development) for more information on editing a Worker.
@@ -35,6 +54,12 @@ addEventListener("fetch", (event) => {
3554
async function handleRequest(request) {
3655
try {
3756
const urlObject = new URL(request.url);
57+
58+
// If the request is to a Vercel verification path, allow it to pass through
59+
if (urlObject.pathname.startsWith('/.well-known/')) {
60+
return await fetch(request);
61+
}
62+
3863
// If the request is to the docs subdirectory
3964
if (/^\/docs/.test(urlObject.pathname)) {
4065
// Then Proxy to Mintlify
@@ -49,11 +74,13 @@ async function handleRequest(request) {
4974
proxyRequest.headers.set("Host", DOCS_URL);
5075
proxyRequest.headers.set("X-Forwarded-Host", CUSTOM_URL);
5176
proxyRequest.headers.set("X-Forwarded-Proto", "https");
77+
// If deploying to Vercel, preserve client IP
78+
proxyRequest.headers.set("CF-Connecting-IP", request.headers.get("CF-Connecting-IP"));
5279

5380
return await fetch(proxyRequest);
5481
}
5582
} catch (error) {
56-
// if no action found, play the regular request
83+
// If no action found, play the regular request
5784
return await fetch(request);
5885
}
5986
}
@@ -110,6 +137,12 @@ If you use Webflow to host your main site and want to serve Mintlify docs at `/d
110137
async function handleRequest(request) {
111138
try {
112139
const urlObject = new URL(request.url);
140+
141+
// If the request is to a Vercel verification path, allow it to pass through
142+
if (urlObject.pathname.startsWith('/.well-known/')) {
143+
return await fetch(request);
144+
}
145+
113146
// If the request is to the docs subdirectory
114147
if (/^\/docs/.test(urlObject.pathname)) {
115148
// Proxy to Mintlify
@@ -121,6 +154,8 @@ If you use Webflow to host your main site and want to serve Mintlify docs at `/d
121154
proxyRequest.headers.set("Host", DOCS_URL);
122155
proxyRequest.headers.set("X-Forwarded-Host", CUSTOM_URL);
123156
proxyRequest.headers.set("X-Forwarded-Proto", "https");
157+
// If deploying to Vercel, preserve client IP
158+
proxyRequest.headers.set("CF-Connecting-IP", request.headers.get("CF-Connecting-IP"));
124159
return await fetch(proxyRequest);
125160
}
126161
// Route everything else to main site

advanced/subpath/route53-cloudfront.mdx

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,31 @@ description: "Host documentation at a /docs subdirectory using AWS services"
66

77
import Propagating from "/snippets/custom-subpath-propagating.mdx";
88

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+
11+
## Proxies with Vercel deployments
12+
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:
20+
21+
- `/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification
22+
- `/.well-known/vercel/*` - Required for Vercel domain verification
23+
24+
These paths should be configured to bypass CloudFront caching and pass through directly to your origin.
25+
26+
### Header forwarding requirements
27+
28+
Ensure that CloudFront forwards the `HOST` header and client IP information correctly. This is critical for Vercel's verification processes.
29+
30+
When using CloudFront with Vercel deployments, CloudFront automatically adds the `CloudFront-Viewer-Address` header containing the original client's IP address.
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.
33+
934
## Create Cloudfront Distribution
1035

1136
Navigate to [Cloudfront](https://aws.amazon.com/cloudfront) inside the AWS console and click on `Create distribution`
@@ -70,19 +95,25 @@ Behaviors in Cloudfront enables control over the subpath logic. At a high level,
7095
- **If a user lands on /docs**, go to `[SUBDOMAIN].mintlify.dev`
7196
- **If a user lands on any other page**, go the current landing page
7297

73-
We're going to create three behaviors by clicking on the `Create behavior` button.
98+
Select the **Create behavior** button and create the following behaviors.
99+
100+
### `/.well-known/*`
101+
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).
103+
104+
For **Cache policy**, select `CachingDisabled` to ensure these verification requests pass through without caching.
74105

75106
### `/docs/*`
76107

77-
The first behavior should have a **Path pattern** of `/docs/*` with **Origin and origin groups** pointing to the `.mintlify.dev` URL (in our case `acme.mintlify.dev`)
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`)
78109

79110
<Frame>![Cloudfront Behavior 1](/images/cloudfront/behavior-1.png)</Frame>
80111

81112
For **Cache policy**, select `CachingOptimized` and create behavior.
82113

83114
### `/docs`
84115

85-
The second behavior should be the same as the first one but with a **Path pattern** of `/docs` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.
116+
Create a behavior with a **Path pattern** of `/docs` and **Origin and origin groups** pointing to the same `.mintlify.dev` URL.
86117

87118
<Frame>![Cloudfront Behavior 2](/images/cloudfront/behavior-2.png)</Frame>
88119

advanced/subpath/vercel.mdx

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,17 @@ title: "Vercel"
33
description: "Host documentation at a /docs subpath using Vercel"
44
---
55

6-
## vercel.json Configuration
6+
## vercel.json file
77

8-
To host your documentation at a custom subpath using Vercel, you need to add the
9-
following configuration to your `vercel.json` file.
8+
The `vercel.json` file is Vercel's configuration file that allows you to customize how your project is built and deployed. It sits in your project's root directory and controls various aspects of your deployment, including routing, redirects, headers, and build settings.
9+
10+
We use the `rewrites` configuration to proxy requests from your main domain to your documentation.
11+
12+
Rewrites allow you to map incoming requests to different destinations without changing the URL in the browser. When someone visits `yoursite.com/docs`, Vercel will internally fetch content from `your-subdomain.mintlify.dev/docs` but the user will still see `yoursite.com/docs` in their browser. This is different from redirects, which would send users to a different URL entirely.
13+
14+
## Configuration
15+
16+
To host your documentation at a custom `/docs` subpath using Vercel, add the following configuration to your `vercel.json` file:
1017

1118
```json
1219
{
@@ -23,8 +30,38 @@ following configuration to your `vercel.json` file.
2330
}
2431
```
2532

26-
<Note>
27-
For more information, you can also refer to Vercel's offical guide on
28-
rewrites: [Project Configuration:
29-
Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites)
30-
</Note>
33+
- **`source`**: The path pattern on your domain that triggers the rewrite.
34+
- **`destination`**: Where the request should be proxied to.
35+
- **`:match*`**: A wildcard that captures any path segments after `/docs/`.
36+
37+
38+
For more information, see [Configuring projects with vercel.json: Rewrites](https://vercel.com/docs/projects/project-configuration#rewrites) in the Vercel documentation.
39+
40+
## Using external proxies with Vercel
41+
42+
If you're using an external proxy (like Cloudflare or AWS CloudFront) in front of your Vercel deployment, you must configure it properly to avoid conflicts with Vercel's domain verification and SSL certificate provisioning.
43+
44+
Improper proxy configuration can prevent Vercel from provisioning Let's Encrypt SSL certificates and cause domain verification failures.
45+
46+
See the [supported providers](https://vercel.com/guides/how-to-setup-verified-proxy#supported-providers-verified-proxy-lite) in the Vercel documentation.
47+
48+
### Required path allowlist
49+
50+
Your external proxy must allow traffic to these specific paths without blocking, redirecting, or heavily caching:
51+
52+
- `/.well-known/acme-challenge/*` - Required for Let's Encrypt certificate verification
53+
- `/.well-known/vercel/*` - Required for Vercel domain verification
54+
55+
These paths should pass through directly to your Vercel deployment without modification.
56+
57+
### Header forwarding requirements
58+
59+
Ensure that your proxy correctly forwards the `HOST` header. Without proper header forwarding, verification requests will fail.
60+
61+
### Testing your proxy setup
62+
63+
To verify your proxy is correctly configured:
64+
65+
1. Test that `https://[yourdomain].com/.well-known/vercel/` returns a response.
66+
2. Ensure SSL certificates are provisioning correctly in your Vercel dashboard.
67+
3. Check that domain verification completes successfully.

api-reference/introduction.mdx

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,37 @@
11
---
2-
title: Introduction
2+
title: "Introduction"
3+
description: "Trigger updates, embed AI assistant, and more"
34
icon: "book-open"
45
---
56

7+
The Mintlify REST API enables you to programmatically interact with your documentation, trigger updates, and embed AI-powered chat experiences.
8+
9+
## Endpoints
10+
11+
- [Trigger Update](/api-reference/update/trigger): Trigger an update of your site when desired.
12+
- [Get Update Status](/api-reference/update/status): Get the status of an update and other details about your docs.
13+
- [Generate Assistant Message](/api-reference/chat/create-assistant-message): Embed the assistant, trained on your docs, into any application of your choosing.
14+
615
## Authentication
716

8-
You can generate an API key through [the dashboard](https://dashboard.mintlify.com/settings/organization/api-keys). The API key is associated with an entire organization and can be used across multiple deployments.
17+
You can generate an API key through [the dashboard](https://dashboard.mintlify.com/settings/organization/api-keys). API keys are associated with an entire organization and can be used across multiple deployments.
18+
19+
### Admin API key
20+
21+
The admin API key is used for the majority of the API. It is used to trigger updates and get update status.
922

10-
<Frame>
11-
<img alt="Screenshot of the API keys page in the Mintlify dashboard." src="/images/external-api-key.png" />
12-
</Frame>
23+
Admin API keys begin with the `mint_` prefix. Keep your admin API keys secret.
1324

14-
## Admin API key
25+
### Assistant API key
1526

16-
The Admin API key is used for the majority of the API. It is used to trigger updates via the [Update endpoint](/api-reference/update/trigger).
27+
The assistant API key is used for generating assistant chat messages through the API. Responses include citations so you can point your users to the right destinations for more information.
1728

18-
## Assistant API key
29+
Assistant API keys begin with the `mint_dsc_` prefix.
1930

20-
The assistant API allows you to embed the AI assistant, trained on your docs and continually kept up to date, into any application of your choosing.
31+
The assistant API **key** is a server-side token that should be kept secret.
2132

22-
Responses include citations so you can point your users to the right destinations for more information.
33+
The assistant API **token** is a public token that can be referenced in your frontend code.
2334

2435
<Note>
25-
The assistant API **token** is a public token that can be referenced in your frontend code. The API **key** is a server-side token that should be kept secret.
26-
2736
Calls using the assistant API token can incur costs: either using your AI chat credits or incurring overages.
2837
</Note>

navigation.mdx

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,7 @@ We currently support the following languages:
435435

436436
## Nesting
437437

438-
It's important to note that you can use any combination of anchors, tabs, and dropdowns - either one can be nested within each other interchangeably.
439-
440-
This way, you can create a very complex navigation structure that is easy to manage.
438+
You can use any combination of anchors, tabs, and dropdowns. The components can be nested within each other interchangeably to create your desired navigation structure.
441439

442440
<CodeGroup>
443441

@@ -512,7 +510,6 @@ This way, you can create a very complex navigation structure that is easy to man
512510
}
513511
```
514512

515-
516513
```json Tabs with external anchors
517514
{
518515
"navigation": {
@@ -557,3 +554,17 @@ This way, you can create a very complex navigation structure that is easy to man
557554
```
558555

559556
</CodeGroup>
557+
558+
---
559+
560+
## Breadcrumbs
561+
562+
Control how breadcrumbs display on individual pages to orient users in your documentation.
563+
564+
```json
565+
{
566+
"styling": {
567+
"eyebrows": "breadcrumbs"
568+
}
569+
}
570+
```

0 commit comments

Comments
 (0)