0

I have the following Nginx virtual host:

server {
        listen 80;
        server_name example.com;
        root /home/me/example.com;
        index index.html

        location /.well-known/ {
                default_type "text/plain";
                root /home/me/example.com/;
        }
}

To test this I have a dummy index.html inside /home/me/domain.com/.well-known/acme-challenge/index.html and when I go there with a browser it is displayed.

But when I run

$ sudo certbot --cert-only

With certbot (using the Ubuntu 20.04 snap version) I enter:

  • example.com when prompted for the domain
  • /home/me/example.com when asked for the webroot

certbot then repports "Connection refused" and quits. Not sure why this is since, as I said, the browser gets to files in http://example.com/.well-known/acme-challenge/index.html (the dummy file I created) just fine. Also the Letsencrypt.log shows the token being written to the correct filesystem path. I have tried several variations of setup and now Letsencrypt has blocked me for some amount of time.

Letsencrypt log here with domain name changed: https://gist.github.com/pferrel/d8083bdb912fc989aa5c1f5087f7ea3d

What am I doing wrong?

EDIT:

  • I have temporarily set permission to 777 for webroot and recursively
  • The error on the CLI is "Connection refused"
pferrel
  • 5,673
  • 5
  • 30
  • 41

0 Answers0