1
0

Fix renewals on separate containers (#165)

* Added support to reload nginx containter in case only certificates renewal happend. Reusing the autodetection from --volumes-from.
This commit is contained in:
PauRE 2017-05-29 00:30:10 +09:00 committed by Yves Blusseau
parent f6c18cc73e
commit a1a6732812
2 changed files with 9 additions and 2 deletions

@ -102,6 +102,8 @@ $ docker run -d \
```
Then start any containers to be proxied as described previously.
* If for some reason you can't use the docker --volumes-from option, you can specify the name or id of the nginx container with `NGINX_PROXY_CONTAINER` variable.
#### Let's Encrypt
To use the Let's Encrypt service to automatically create a valid certificate for virtual host(s).

@ -70,9 +70,14 @@ function docker_kill {
## Nginx
reload_nginx() {
if [[ -n "${NGINX_DOCKER_GEN_CONTAINER:-}" ]]; then
# Using docker-gen separate container
echo "Reloading nginx proxy (using separate container ${NGINX_DOCKER_GEN_CONTAINER})..."
# Using docker-gen and nginx in separate container
echo "Reloading nginx docker-gen (using separate container ${NGINX_DOCKER_GEN_CONTAINER})..."
docker_kill "$NGINX_DOCKER_GEN_CONTAINER" SIGHUP
if [[ -n "${NGINX_PROXY_CONTAINER:-}" ]]; then
# Reloading nginx in case only certificates had been renewed
echo "Reloading nginx (using separate container ${NGINX_PROXY_CONTAINER})..."
docker_kill "$NGINX_PROXY_CONTAINER" SIGHUP
fi
else
if [[ -n "${NGINX_PROXY_CONTAINER:-}" ]]; then
echo "Reloading nginx proxy..."