It produced this output:
Failed authorization procedure. ldapwiki.com (http-01): urn:acme:error:unauthorized :: The client lacks sufficient authorization :: Invalid response from http://ldapwiki.com/.well-known/acme-challenge/c
My web server is (include version):
nginx version: nginx/1.10.3 (Ubuntu)
The operating system my web server runs on is (include version):
Ubuntu 16.04.3 LTS
My hosting provider, if applicable, is:
linode
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): N/A
I believe the issue is with the webroot directory you specified. I would find it surprising that your webroot is /var/www/letsencrypt, and I’m assuming what you did is map that to /.well-known/acme-challenge instead. This will cause certbot to serve the file at /.well-known/acme-challenge/.well-known/acme-challenge, because webroot expects the directory at which you are serving /.
If I remember correctly, this maps /.well-known/acme-challenge on the site to /var/www/letsencrypt instead of the intended /var/www/letsencrypt/.well-known/acme-challenge. The correct form would probably be to created /var/www/letsencrypt/.well-known/acme-challenge and then set root /var/www/letsencrypt/.well-known/acme-challenge, or, alternatively, to keep it as it is and create /var/www/letsencrypt/.well-known and then ln -s /var/www/letsencrypt /var/www/letsencrypt/.well-known/acme-challenge.
“location with root inside” seems confusing.
I’ve always seen “location with alias inside”.
Like:
location /.well-known {
alias /var/www/letsencrypt/.well-known;
}
Ok. For me, your tomcat-proxy.conf is ok so the problem should be in another side. I suppose you already enabled this conf right?. I mean, is there a link in /etc/nginx/sites-enabled/tomcat-proxy.conf pointing to /etc/nginx/sites-available/tomcat-proxy.conf?.
Could you please also check if you have some kind of port forwarding from port 80 to 8080?. I'm asking because I'm still viewing that your tomcat is answering directly instead of being proxified by nginx.
$ curl -IkL http://ldapwiki.com/.well-known/acme-challenge/test
HTTP/1.1 404 Not Found
Server: Apache-Coyote/1.1
Content-Type: text/html;charset=utf-8
Content-Language: en
Content-Length: 1013
Date: Mon, 28 Aug 2017 18:28:51 GMT