How to get certbox --nginx working?

Hi everyone,

I have a certbot certificate successfully working for two domains and a blog which is a subdomain of one of the domains.

I am trying to add another subdomain to the certificate but even after successfully renewing and adding the domain to the certificate it still does not visit as a protected url.

Here is the results of my certbot certificates command:
Note: all domains with example are currently working. newdomain is working as well, but the subdomain blog.newdomain.io is what is not working and I am trying to add.

  Certificate Name: blog.example.net
    Domains: blog.example.net www.blog.example.net
    Expiry Date: 2018-02-28 01:21:48+00:00 (VALID: 72 days)
    Certificate Path: /etc/letsencrypt/live/blog.example.net/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/blog.example.net/privkey.pem

  Certificate Name: blog.newdomain.io
    Domains: blog.newdomain.io www.blog.newdomain.io
    Expiry Date: 2018-01-20 01:28:08+00:00 (VALID: 33 days)
    Certificate Path: /etc/letsencrypt/live/blog.newdomain.io/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/blog.newdomain.io/privkey.pem

  Certificate Name: newdomain.io
    Domains: newdomain.io www.newdomain.io
    Expiry Date: 2018-02-28 01:21:59+00:00 (VALID: 72 days)
    Certificate Path: /etc/letsencrypt/live/newdomain.io/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/newdomain.io/privkey.pem

  Certificate Name: example.net
    Domains: newdomain.io blog.newdomain.io blog.example.net example.ca example.net www.blog.newdomain.io www.blog.example.net www.newdomain.io www.example.ca www.example.net
    Expiry Date: 2018-03-17 01:16:52+00:00 (VALID: 89 days)
    Certificate Path: /etc/letsencrypt/live/example.net/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/example.net/privkey.pem

I have tried running certbot --nginx but it is returning this error:

Error while running nginx -c /etc/nginx/nginx.conf -t.

nginx: [emerg] open() "/etc/nginx/snippets/ssl-blog.example.io.conf" failed (2: No such file or directory) in /etc/nginx/conf.d/blog.example.io.conf:31
nginx: configuration file /etc/nginx/nginx.conf test failed

The nginx plugin is not working; there may be problems with your existing configuration.
The error was: MisconfigurationError('Error while running nginx -c /etc/nginx/nginx.conf -t.\n\nnginx: [emerg] open() "/etc/nginx/snippets/ssl-blog.example.io.conf" failed (2: No such file or directory) in /etc/nginx/conf.d/blog.example.io.conf:31\nnginx: configuration file /etc/nginx/nginx.conf test failed\n',)

The redacted domain names make it a bit confusing, but the error message seems to suggest that your nginx configuration is referring to a file that doesn’t exist - perhaps one that’s been deleted? What’s on the mentioned line 31 of /etc/nginx/conf.d/blog.example.io.conf?

(Note that certbot --nginx might not work right now anyway, due to the ongoing tls-sni-01 issue, but it should be fixed in an upcoming certbot update, or you can use certbot -a webroot -i nginx if you can’t wait. However, while your config is broken it will likely have the same problem)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.