I'm running my Django application on Digital Ocean with Ubuntu 16.04/Nginx/Gunicorn. I issued a (SSL?) certificate by running the following command:
sudo certbot --authenticator webroot --webroot-path /home/user/app --installer nginx -d aaa.com -d www.aaa.com
however I now want to change my domain from aaa.com
to bbb.com
. How do I keep my certificate for my new domain? When I ran the command to issue the certificate, I assume it created various files such as the directory .well-known
- and also added code in my Nginx conf. So do I simply run the same command again, with the new domain in?
sudo certbot --authenticator webroot --webroot-path /home/user/app --installer nginx -d bbb.com -d www.bbb.com
or do I just change the current code and replace it with the new domain? E.g. my Nginx conf looks like this:
ssl_certificate /etc/letsencrypt/live/aaa.com/fullchain.pem; #
managed by Ce$
ssl_certificate_key /etc/letsencrypt/live/aaa.com/privkey.pem; # managed by $
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
I've already changed:
server {
listen 80;
server_name 172.128.67.232 bbb.com www.bbb.com;
location = /favicon.ico { access_log off; log_not_found off; }
location /static/ {
root /home/user/app;
}
to my new domain bbb.com
.
Advice appreciated.