Automatic certificate upgrade
Schedule certificate renewal with certbot in /etc/crontab. Running the reverse proxy on the host simplifies replacement of the renewed certificates.
Add a certbot renewal command to /etc/crontab to run it at scheduled intervals.
Example entry in /etc/crontab:
$ echo "0 0,12 * * * root python -c 'import random; import time; time.sleep(random.random() * 3600)' && certbot renew -q" \
sudo tee -a /etc/crontab > /dev/null
Replacing the certificate secret while the Reverse Proxy service is running requires additional steps. Move the reverse proxy configuration to the host so that certbot can replace the certificate files directly.
The next section describes how to configure the reverse proxy on the host.