Files
mintlify__docs/fr/deploy/reverse-proxy.mdx
locadex-agent[bot] 83476f17a8 docs(locadex): add translations (#2998)
Co-authored-by: locadex-agent[bot] <217277504+locadex-agent[bot]@users.noreply.github.com>
2026-01-30 10:39:47 -08:00

189 lines
7.6 KiB
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "Proxy inverse"
description: "Configurer un proxy inverse personnalisé pour diffuser votre documentation."
keywords: ["configuration de proxy inverse", "nginx", "routage du proxy", "transmission des en-têtes"]
---
<Note>
Les configurations de proxy inverse ne sont prises en charge que pour les [offres Enterprise](https://mintlify.com/pricing?ref=reverse-proxy).
</Note>
Pour diffuser votre documentation via un proxy inverse personnalisé, vous devez configurer des règles de routage, des stratégies de mise en cache et la transmission des en-têtes.
Lorsque vous mettez en place un proxy inverse, surveillez les problèmes potentiels liés à la vérification du domain, à l’émission des certificats SSL, aux parcours d’authentification, aux performances et au suivi Analytics.
<div id="routing-configuration">
## Configuration du routage
</div>
Redirigez ces chemins vers votre sous-domaine Mintlify avec les politiques de mise en cache indiquées :
| Chemin | Destination | Mise en cache |
| --------------------------------- | ------------------------------- | ------------- |
| `/.well-known/acme-challenge/*` | `<your-subdomain>.mintlify.app` | Pas de cache |
| `/.well-known/vercel/*` | `<your-subdomain>.mintlify.app` | Pas de cache |
| `/.well-known/skills/*` | `<your-subdomain>.mintlify.app` | Pas de cache |
| `/skill.md` | `<your-subdomain>.mintlify.app` | Pas de cache |
| `/mintlify-assets/_next/static/*` | `<your-subdomain>.mintlify.app` | Cache activé |
| `/_mintlify/*` | `<your-subdomain>.mintlify.app` | Pas de cache |
| `/*` | `<your-subdomain>.mintlify.app` | Pas de cache |
| `/` | `<your-subdomain>.mintlify.app` | Pas de cache |
<div id="required-header-configuration">
## Configuration d’en-têtes requise
</div>
Configurez votre reverse proxy avec les en-têtes suivants :
- **Origin** : contient le sous-domaine cible `<your-subdomain>.mintlify.app`
- **X-Forwarded-For** : conserve les informations d’adresse IP du client
- **X-Forwarded-Proto** : conserve le protocole d’origine (HTTP/HTTPS)
- **X-Real-IP** : transmet la véritable adresse IP du client
- **User-Agent** : transmet l’agent utilisateur
<Warning>
Assurez-vous que l’en-tête `Host` n’est pas transmis
</Warning>
<div id="example-nginx-configuration">
## Exemple de configuration Nginx
</div>
```nginx
server {
listen 80;
server_name <your-domain>.com;
# Let's Encrypt verification paths
location ~ ^/\.well-known/acme-challenge/ {
proxy_pass https://<your-subdomain>.mintlify.app;
proxy_set_header Origin <your-subdomain>.mintlify.app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
# Désactiver la mise en cache pour les chemins de vérification
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Vercel verification paths
location ~ ^/\.well-known/vercel/ {
proxy_pass https://<your-subdomain>.mintlify.app;
proxy_set_header Origin <your-subdomain>.mintlify.app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
# Désactiver la mise en cache pour les chemins de vérification
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# AI skills paths
location ^~ /.well-known/skills/ {
proxy_pass https://<your-subdomain>.mintlify.app;
proxy_set_header Origin <your-subdomain>.mintlify.app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
# Désactiver la mise en cache pour les chemins de vérification
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Skill manifest
location = /skill.md {
proxy_pass https://<your-subdomain>.mintlify.app;
proxy_set_header Origin <your-subdomain>.mintlify.app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
# Disable caching for skill manifest
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Static assets with caching
location ~ ^/mintlify-assets/_next/static/ {
proxy_pass https://<your-subdomain>.mintlify.app;
proxy_set_header Origin <your-subdomain>.mintlify.app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
# Enable caching for static assets
add_header Cache-Control "public, max-age=86400";
}
# Mintlify-specific paths
location ~ ^/_mintlify/ {
proxy_pass https://<your-subdomain>.mintlify.app;
proxy_set_header Origin <your-subdomain>.mintlify.app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
# Disable caching for Mintlify paths
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# Root path
location = / {
proxy_pass https://<your-subdomain>.mintlify.app;
proxy_set_header Origin <your-subdomain>.mintlify.app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
# Disable caching for dynamic content
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
# All other documentation paths
location / {
proxy_pass https://<your-subdomain>.mintlify.app;
proxy_set_header Origin <your-subdomain>.mintlify.app;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header User-Agent $http_user_agent;
# Disable caching for dynamic content
add_header Cache-Control "no-cache, no-store, must-revalidate";
}
}
```
<div id="troubleshooting">
## Résolution des problèmes
</div>
<div id="404-error">
### Erreur 404
</div>
**Symptômes :** La documentation se charge, mais certaines fonctionnalités ne fonctionnent pas. Les appels à l’API échouent.
**Cause :** L’en-tête `Host` est transmis ou l’en-tête `Origin` est manquant.
**Solution :**
- Supprimer le transfert de l’en-tête `Host`
- Définir l’en-tête `Origin` sur `<your-subdomain>.mintlify.app`
<div id="performance-issues">
### Problèmes de performances
</div>
**Symptômes** : temps de chargement lents et décalages de mise en page.
**Cause** : configuration de la mise en cache incorrecte.
**Solution** : activez la mise en cache uniquement pour les chemins `/mintlify-assets/_next/static/*`.