Certbot not discovering domains on nginx

My domain is: internal.securelyshare.com

I ran this command:
sudo certbot --nginx

It produced this output:
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Starting new HTTPS connection (1): acme-v02.api.letsencrypt.org
No names were found in your configuration files. Please enter in your domain
name(s) (comma and/or space separated) (Enter ‘c’ to cancel): c

My web server is (include version):
nginx version: nginx/1.16.1

The operating system my web server runs on is (include version):
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial

My hosting provider, if applicable, is:
Self hosted

I can login to a root shell on my machine (yes or no, or I don’t know):
Yes

I’m using a control panel to manage my site (no, or provide the name and version of the control panel):
No

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you’re using Certbot):
certbot 0.31.0

Hello,
My site was working fine till today. I upgraded nginx from 1.10.3 to 1.16.1
My site is accessible. But SSL is not working. So I tried to renew/redeploy the certificates. But the discovery is not working.

Hi @prawen

looks like you don't have a correct defined port 80 vHost. Please add one. Check the nginx documentation, there are a lot of samples.

Hello,

Thanks for your response.

My nginx server is already serving multiple sites and they are accessible on port 80.
It was accessible on 443 before upgrading nginx

Here is one of the site enabled FYI

server {
	root /var/www/html;
	index index.html index.htm index.nginx-debian.html;
	server_name internal.securelyshare.com;
	location / {
            something here blah blah blah
	}
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/internal.securelyshare.com/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/internal.securelyshare.com/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
    if ($host = internal.securelyshare.com) {
        return 301 https://$host$request_uri;
    } # managed by Certbot
	server_name internal.securelyshare.com;
    listen 80;
    return 404; # managed by Certbot
}

Please read your own question. Your question says: That vHost doesn't work, that's part of the problem.

Checking your domain -> the same result, there is no redirect http -> https.

You are correct. I see Nginx has changed their directory structure in this version. I figured out. Thanks for your help.

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