Finally I got my letsencrypt beta invite(thanks for the great work you are doing!) and managed to create a reasonable setup for docker users which I would like to share and also receive feedback on how to improve.
I added a location in my nginx config redirectig the acme-challenge requests to the letsencrypt docker container instead of the actual application.
location /.well-known/acme-challenge {
proxy_pass http://localhost:1086;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Forwarded-Proto https;
}
Then i request the certificate using the letsencrypt docker image
docker run -it --rm -p 1086:80 -p 1087:443 --name letsencrypt \
-v "/etc/letsencrypt:/etc/letsencrypt" \
-v "/var/lib/letsencrypt:/var/lib/letsencrypt" \
quay.io/letsencrypt/letsencrypt:latest auth --agree-dev-preview --server \
https://acme-v01.api.letsencrypt.org/directory -d my.example.com
I had to forward ports 443 and 80 to successfully request a certificate, this was an issue in the current documentation.
A more detailed description including a sample config can be found at github
The setup works fine for requesting a certificate for the first time, but renewals currently fail with the following error:
Failed authorization procedure. my.example.com (dvsni): unauthorized :: The client lacks sufficient authorization :: Correct zName not found for TLS SNI challenge
I tested it on the live and testing environment with the same error. Are renewals currently not supported?