add reloadcmd to existing certs

I'm having trouble applying a --reloadcmd "service nginx reload" to I found out that this is not applicable during cron execution by design, so I tried running this command to update all my certs with a reloadcmd: --renew-all --home "/root/" --cert-home "/etc/letsencrypt/live" --reloadcmd "service nginx reload" >> /root/

This does, however, not work. My certificates are successfully renewed, but NGINX isn't reloaded to reflect the change. I have to do this manually.
Any idea how to add reload-cmd's the correct way to existing certificates without breaking anything?

1 Like

I tend to use "nginx -s reload" myself, but I'm not exactly sure of the fit with

1 Like

Hello @plann,

Warning: Always backup your /root/ directory and as you are using it, also /etc/letsencrypt/live/ just in case. --install-cert -d hereyourdomain --home "/root/" --cert-home "/etc/letsencrypt/live" --reloadcmd "service nginx reload"

You should do this one by one for all your certificates or create a simple for loop that checks the names in /etc/letsencrypt/live/ and add them to the command.

Edit: I forgot to add the for loop example.

for i in /etc/letsencrypt/live/*; do --install-cert -d $(basename $i) --home "/root/" --cert-home "/etc/letsencrypt/live" --reloadcmd "service nginx reload"; done



This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.