Skip to content

Instantly share code, notes, and snippets.

@jbutko
Last active October 2, 2018 11:48
Show Gist options
  • Save jbutko/9c3b2defd583f9ce79470a9f573be294 to your computer and use it in GitHub Desktop.
Save jbutko/9c3b2defd583f9ce79470a9f573be294 to your computer and use it in GitHub Desktop.
Nginx: renew certs cron job
# try to renew certs every sunday at 02:00 and log the result in /var/log/lets-encrypt-renew.log
0 2 * * 7 /opt/certbot/certbot-auto renew --dry-run --pre-hook "nginx service stop" --post-hook "nginx service start" >> /var/log/lets-encrypt-renew.log
# renewing manually
be sure to enable 80 port, disable all 301/302 redirects in your `.conf` files so letsencrypt can access http challenges
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment