Issue with adding subdomain to existing config, nginx webroot method

Please fill out the fields below so we can help you better.

My domain is:

I ran this command: certbot certonly --webroot -w “/var/www/html” -d -d

It produced this output: - The following errors were reported by the server:

Type: unauthorized
Detail: Invalid response from

<html class="ie ie7 oldi" To fix these errors, please make sure that your domain name was entered correctly and the DNS A record(s) for that domain contain(s) the right IP address. My operating system is (include version): Debian 8 My web server is (include version): nginx 1.6.2 My hosting provider, if applicable, is: Digital Ocean 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 Hi Guys Created the first cert fine for the non-www domain. Later realised I should have included www! My renew command works (which just renews the non-www). Nginx is set up to redirect http to https, excluding the lets-encrypt folder: server { listen 80; server_name; location /.well-known { alias /var/www/html/.well-known; } location / { return 301$request_uri; } } If I create a file inside /var/www/html/.well-known I can curl it from my other server using either www. or non-www. Not entirely sure what I'm missing here! Thanks

The DNS records for point to a different IP:

➜  ~ dig A
➜  ~ dig A

You’ll probably want to chang that to be point to the same IP (or CNAME to, otherwise domain validation won’t work.

It’s an awful feeling when you realise you’re an idiot :sweat:

Thanks! I really should have spotted that.

EDIT: Confirmed working now. Thanks again. I feel a bit silly.

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