How to use/update certbot certificate
I always hated doing this for Nginx, because Nginx was behind Apache on creating a helper script, and those are always less reliable than straight terminal commands anyway. This command gets around annoying things and gives you:
- One single certificate that doesn't randomly change its name to 001, 002, etc.
- Multiple domains in the same certificate, for Nginx config copy/paste easiness
- No annoying questions asked by the script, just update my stuff please
Here is the command:
./certbot-auto certonly --nginx --expand --agree-tos -d octobeta.com -d www.octobeta.com --cert-name=nonewfilesplz
(The -d is for domain, and you can have unlimited of these parameters.)
Useful information which is printed out:
IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/nonewfilesplz/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/nonewfilesplz/privkey.pem
Use those two locations in your Nginx config like so:
server {
# ...etc
ssl_certificate /etc/letsencrypt/live/nonewfilesplz/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/nonewfilesplz/privkey.pem; # managed by Certbot
# ...etc
}