nginx - Docker letsencrypt does not appear to be creating webroot files -


i have nginx service running following configuration

location /.well-known {         root /tmp/letsencrypt/; } 

i execute following docker command

sudo docker run -it --rm --name certbot \         -v /etc/letsencrypt \         -v /var/lib/letsencrypt \         -v /tmp/letsencrypt \         quay.io/letsencrypt/letsencrypt:latest certonly \         --webroot --webroot-path /tmp/letsencrypt \         -d dev.blockloop.io --renew-by-default 

i following output letsencrypt

type:   unauthorized detail: invalid response http://dev.blockloop.io/.well-known/acme-challenge/wupz1yyldrv8djryegofxfz24rjcwrrenqxboyndo30: "<html> <head><title>404 not found</title></head> <body bgcolor="white"> <center><h1>404 not found</h1></center> <hr><center>" 

and nginx logs this

nginx_1  | 2016/05/28 20:10:44 [error] 6#6: *1 open() "/tmp/letsencrypt/.well-known/acme-challenge/wupz1yyldrv8djryegofxfz24rjcwrrenqxboyndo30" failed (2: no such file or directory), client: 66.133.109.36, server: dev.blockloop.io, request: "get /.well-known/acme-challenge/wupz1yyldrv8djryegofxfz24rjcwrrenqxboyndo30 http/1.1", host: "dev.blockloop.io" nginx_1  | 66.133.109.36 - - [28/may/2016:20:10:44 +0000] "get /.well-known/acme-challenge/wupz1yyldrv8djryegofxfz24rjcwrrenqxboyndo30 http/1.1" 404 169 "-" "mozilla/5.0 (compatible; let's encrypt validation server; +https://www.letsencrypt.org)" 

when in /tmp/letsencrypt expect see files leftover letsencrypt, thing there empty .well-known directory. suspect either letsencrypt cleaning or it's not creating files.

if drop index.html file in /tmp/letsencrypt/.well-known , go http://dev.blockloop.io/.well-known/ see contents know nginx working properly.

i managed fix problem somehow. think solution trailing slash @ end of --webroot-path /tmp/letsencrypt/, knows. here's resulting script. else remained same.

sudo docker run -it --rm --name certbot \         -v "/etc/letsencrypt:/etc/letsencrypt" \         -v "/var/lib/letsencrypt:/var/lib/letsencrypt" \         -v "/tmp/letsencrypt:/tmp/letsencrypt" \         quay.io/letsencrypt/letsencrypt:latest certonly \         --webroot --webroot-path /tmp/letsencrypt/ \         -d dev.blockloop.io --renew-by-default 

Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -