Renewal hook for certain domains

I need to restart Nginx after renewal, but only for certain domains.
I know I can create a renewal hook, but I understand that this would be run after every renewal.

Is there a way to have different renewal hooks for different domains?


Yes, you can use --deploy-hook /path/to/hook on a per-certificate basis.

If your certificate already exists, you can open up the /etc/letsencrypt/renewal/*.conf file, and under [renewalparams], add:

renew_hook = /path/to/hook

You could also continue using /etc/letsencrypt/renewal-hooks/, but write your hook so that it performs its work selectively, based on the value of the $RENEWED_LINEAGE env variable.

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