I have an nginx running. Now I want my nginx to use SSL:
certbot-auto --nginx -d my.domain.com -n --agree-tos --email [email protected]
OUTPUT:
Performing the following challenges:
tls-sni-01 challenge for my.domain.com
Cleaning up challenges
Cannot find a VirtualHost matching domain my.domain.com.
my.domain.com is pointing to the IP of my server. It's its dns name.
What am I doing wrong? I did this already for apache and it was working fine. My nginx is running (and I'm not able to restart it manually after the certbot-auto
but this wasn't necessary when I used certbot-auto --apache
Did you know that you can quickly configure your Let's Encrypt certificates to automatically renew themselves by executing a simple letsencrypt auto-renew script? Configuring auto-renew for you Let's Encrypt SSL certificates means your website will always have a valid SSL certificate.
Turn on Auto-Renew In the Order # column, click the Quick View link of the SSL certificate. In the Quick View pane on the right, click + Show More Certificate Info... to expand the Order Details section. Under Auto-Renew, check the box or select the total number of times you want to renew the certificate.
In my case, I had to add the "server_name" line because it wasn't in my nginx config so it was giving me the error message "Cannot find a VirtualHost matching domain my.domain.com" when I ran:
certbot --nginx
Make sure this is in your config:
server {
server_name my.domain.com;
....
}
Your are probably missing some Server Blocks (virtual hosts) files in the sites-enabled folder. Check if your config files exist in /etc/nginx/sites-available
and /etc/nginx/sites-enabled
. If they are not present in the sites-enabled folder, create symbolic links for them:
$ sudo ln -s /etc/nginx/sites-available/my.domain.com /etc/nginx/sites-enabled/
Add your site, check for config errors and restart nginx:
$ sudo certbot --nginx -d my.domain.com
$ sudo nginx -t
$ sudo service nginx restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With