Redirect all requests to HTTPS, except for one subdirectory
Try this:
server {
listen 80;
server_name sub.domain.tld;
server_tokens off;
root /var/www/letsencrypt;
location /.well-known {
try_files $uri $uri/ =404;
}
location / {
return 301 https://$host$request_uri;
}
}
Since there was no try_files
entry in your virtual server, it didn't know what to do with requests coming to /.well-known
.