Skip to content

Commit

Permalink
Merge pull request #1166 from nginx-proxy/reload-more-often
Browse files Browse the repository at this point in the history
fix: reload nginx on each created or renewed cert
  • Loading branch information
buchdag authored Nov 24, 2024
2 parents 3bc3791 + 4726a87 commit 2b4e176
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/letsencrypt_service
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,9 @@ function update_cert {
fi
done

if ! parse_true "${RELOAD_NGINX_ONLY_ONCE:-false}" && parse_true $should_reload_nginx; then
reload_nginx
fi
}

function update_certs {
Expand Down
2 changes: 2 additions & 0 deletions docs/Container-configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ You can also create test certificates per container (see [Test certificates](./L
* `ACME_POST_HOOK` - The provided command will be run after every certificate issuance. The action is limited to the commands available inside the **acme-companion** container. For example `--env "ACME_POST_HOOK=echo 'end'"`. For more information see [Pre- and Post-Hook](./Hooks.md)

* `ACME_HTTP_CHALLENGE_LOCATION` - Previously **acme-companion** automatically added the ACME HTTP challenge location to the nginx configuration through files generated in `/etc/nginx/vhost.d`. Recent versions of **nginx-proxy** (>= `1.6`) already include the required location configuration, which remove the need for **acme-companion** to attempt to dynamically add them. If you're running and older version of **nginx-proxy** (or **docker-gen** with an older version of the `nginx.tmpl` file), you can re-enable this behaviour by setting `ACME_HTTP_CHALLENGE_LOCATION` to `true`.

* `RELOAD_NGINX_ONLY_ONCE` - The companion reload nginx configuration after every new or renewed certificate. Previously this was done only once per service loop, at the end of the loop (this was causing delayed availability of HTTPS enabled application when multiple new certificates where requested at once, see [issue #1147](https://github.com/nginx-proxy/acme-companion/issues/1147)). You can restore the previous behaviour if needed by setting the environment variable `RELOAD_NGINX_ONLY_ONCE` to `true`.

0 comments on commit 2b4e176

Please sign in to comment.