Regenerating nginx config

I successfully set up certbot and had working https to several of my sites \o/ …but I’m using Ansible to add nginx vhost files. Having made some changes to how my ansible plays are working the vhost files with letsencrypt config have been overwritten and thus have lost the config.

I don’t see any way to tell certbot to re-add the config to the vhost files specifically (and not regenerate new certs). It seems the only workaround would be deleting the certs or otherwise forcing a renewal.

Can anyone suggest a workaround? How do you deal with this issue?


Can you confirm if you still got those listen 443 vHosts?

If you run the original command, e.g. "certbot --nginx -d", and the certificate isn't close to expiring, it should offer to reinstall it. Passing "--keep" will make it do that without asking.

1 Like

@mnordhoff Thanks, that looks like just what I need! Now have them working again - and a way to regenerate config via ansible if required.

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