renew-hook has been deprecated in recent versions of certbot. Plus, debian moved from using cronjobs for automatic renewals to systemd timer if they are available. On the other hand, now certbot supports having hooks in configuration files.
Create a file /etc/letsencrypt/renewal-hooks/deploy/01-reload-nginx with the following content:
1 2 3 4 5 |
#! /bin/sh set -e /etc/init.d/nginx configtest /etc/init.d/nginx reload |
Don’t forget to make the file executable.