I use Ubuntu 16.04 with Nginx and I've installed Nginx Certbot on my operating system (Ubuntu 16.04) with:
apt-get update -y
add-apt-repository ppa:certbot/certbot -y
apt-get update -y
apt-get upgrade python-certbot-nginx -y
I setted Nginx variables:
s_a="/etc/nginx/sites-available"
s_e="/etc/nginx/sites-available"
I created an app conf based on these variables:
sed "s/\${domain}/${1}/g" "~/${repo}/template_nginx_app" > "${s_a}/${domain}.conf"
ln -sf ${s_a}/${domain}.conf ${s_e}
I created a correspondent SSL certificate with Certbot based on the app conf, this way:
certbot --nginx -d ${domain} -d www.${domain}
There are cases an SSL certificate is created in a bad way and one just need to start over after some configurations.
How could I totally remove the SSL certificate (besides removing the app conf ${domain}.conf
which was also edited/reconfigured by Certbot) ?
Is there a fast way to do that directly from Certbot? My desire is that no remnants whatsoever would left for both app conf and certificate.
This might be the good way:
rm ${s_a}/${domain}.conf && rm ${s_e}/${domain}.conf
rm -rf /etc/letsencrypt/{live,renewal,archive}/{${DOMAIN},${DOMAIN}.conf}