[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian, nginx et Let's Encrypt



Jean-Marc a écrit :
> > Via cron :
> > 
> > # crontab -e
> > 43 23 * * * /usr/bin/certbot --quiet renew --pre-hook "systemctl stop nginx" --post-hook "systemctl start nginx"
> 
> Donc, tu redémarres nginx tous les soirs ?

Non, certbot est plus intelligent que cela, voici un extrait de la page
de man :

  --pre-hook PRE_HOOK

      Command to be run in a shell before obtaining any certificates.
      Intended primarily for renewal, where it can be used to
      temporarily shut down a webserver that might conflict with the
      standalone plugin. *This will only be called if a certificate is
      actually to be obtained/renewed*. When renewing several
      certificates that have identical pre-hooks, only the first will be
      executed. (default: None)

Et les logs montrent qu'effectivement, le serveur web n'est redémarré
que lorsque le certificat doit effectivement être renouvelé.

Sébastien


-- 
Sébastien Dinot, sebastien.dinot@free.fr
http://sebastien.dinot.free.fr/
Ne goûtez pas au logiciel libre, vous ne pourriez plus vous en passer !


Reply to: