certbot : certificat Let's Encrypt pour nginx avec redirection HTTPS et OCSP stapling
Commande certbot unique pour obtenir un certificat, configurer nginx, rediriger vers HTTPS et activer l'agrafage OCSP.
Commande certbot pour obtenir un certificat Let's Encrypt et configurer nginx en une seule fois, avec redirection HTTP vers HTTPS.
sudo certbot --nginx --agree-tos --redirect --staple-ocsp --email user@example.com -d app.example.com
| Option | Rôle |
|---|---|
--nginx |
utilise le plugin nginx pour obtenir le certificat et modifier la configuration |
--agree-tos |
accepte les conditions d'utilisation de l'autorité de certification |
--redirect |
redirige automatiquement le HTTP vers le HTTPS |
--staple-ocsp |
active l'agrafage OCSP (OCSP stapling) |
--email |
adresse de contact pour les notifications d'expiration |
-d |
nom de domaine à certifier |
Remarques
- Le domaine doit pointer vers le serveur et le port 80 doit être accessible pour la validation.
- L'agrafage OCSP dépend du support OCSP de l'autorité de certification : vérifiez qu'il est toujours proposé pour vos certificats.