My server runs on a LEMP Stack Ubuntu 16.04 and last version of nginx
I already have a SSL certificate installed on my server for the following domains and subdomains : example.com
, domain1.example.com
and everything is working fine.
What I try to achieve
I'd like to create a new certificate for domain2.example.com
To do so, I tried this command:
sudo certbot --nginx -d example.com -d domain1.example.com -d domain2.example.com --expand
Error message
Cannot find a cert or key directive in /etc/nginx/sites-enabled/example.com for set(['www.example.com', '*.example.com', 'example.com']). VirtualHost was not modified.
nginx config
server {
# SSL configuration
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;
include snippets/ssl-example.com.conf;
include snippets/ssl-params.conf;
root /var/www/laravel/public;
index index.php index.html index.htm;
server_name example.com *.example.com www.example.com ;
}
Questions
What am I doing wrong ? How can I recreate the certificate to add the domain2
?
ssl_certificate
andssl_certificate_key
in the appropriateserver
block, I'd recommend doing it by hand. If you want to keep the question open, I'd recommend giving the path of the NGINX configuration since Certbot looks for a specific file.