Docker: Reload Nginx Inside Container

If you want to update Nginx configuration or renew SSL certificates, you should reload Nginx to apply modifications.

If you run Nginx inside Docker container you might be curious how to reload it without any downtime or connection interruptions.

The best way to reload Nginx inside Docker container is to run docker container exec command and send reload signal to the Nginx.

Cool Tip: Enter a running Docker container and start a bash session! Read More →

Check Nginx configuration for correct syntax:

$ docker container exec <container> nginx -t

Reload Nginx inside Docker container:

$ docker container exec <container> nginx -s reload