Nginx with automatical letsencrypt certificate renewal
2.5K
A simple naive docker image, to run nginx with letsencrypt certificate renewal periodically (once in 5d).
docker run -d --name my-nginx-with-le \
-p 80:80 -p 443:443 \
-v /srv/webroot:/srv/web \
-v /srv/letsencrypt:/etc/letsencrypt \
-e EMAIL="[email protected]" \
-e DOMAIN_NAME="example.com sss.example2.com" \
senorsen/nginx-letsencrypt:latest
This image also contains a simple git-auto-pull.
EMAIL your email pass to certbotDOMAIN_NAME domain(s), multiple domains should seperated by space, and the first domain is used as common name (CN)DISABLE_DEFAULT_CONF if set, 000-default.conf nginx conf will not be generatedDISABLE_UPDATE_NGINX_RESOLVER if set, we won't update nginx resolver configuration accoring to docker (the one set by docker in /etc/resolv.conf)PRE_UP_SCRIPT script run before nginx upQ: Looking for proxy_pass or more complicated nginx configuration?
A: Set env DISABLE_DEFAULT_CONF, then write your own config.
ENV DISABLE_DEFAULT_CONF 1
COPY your-nginx-config.conf /etc/nginx/conf.d/
Content type
Image
Digest
Size
35.3 MB
Last updated
about 9 years ago
docker pull senorsen/nginx-letsencrypt