JonasAlfredsson / docker-nginx-certbot

Automatically create and renew website certificates for free using the Let's Encrypt certificate authority.
https://hub.docker.com/r/jonasal/nginx-certbot
MIT License
938 stars 167 forks source link

Signal handler for SIGUSR1 #249

Closed fredrikekre closed 4 months ago

fredrikekre commented 4 months ago

This patch adds a signal handler for SIGUSR1 that forwards the signal to nginx telling it to reopen log files. This is necessary after rotating log files, for example. See https://nginx.org/en/docs/control.html#logs. Previously we did something like

docker exec <container_name> /bin/bash -c 'kill -USR1 `pgrep -f "nginx: [m]aster"`'

but support for sending SIGUSR1 directly to the container is a bit nicer IMO.

This patch also adds a section on signal handling under "Advanced Usage" in the documentation.

JonasAlfredsson commented 4 months ago

This is an excellent pull request, gold star for adding documentation!

I merge this now which will build the latest tag, and I will see if I manage to do a proper release tag this evening or tomorrow :)

fredrikekre commented 4 months ago

Thanks!