If you’re making changes to your nginx configuration files, you are running a huge risk if you restart nginx and you made a mistake, a typo, or copied and pasted from Stackoverflow wrong. Luckily there’s an easy built-in way to test your configuration files to make sure they won’t break everything.
After you make configuration changes to your web server or other service, you generally have to restart the process to get it to recognize the updated settings. The problem is that the regular restart first kills the process and all of the worker processes, and then starts it all up again — which will (briefly) make your website go offline.
While setting up this site, I wanted to work on articles and tweaking things before actually launching to the public, so I needed a simple way to keep everybody else out until it was all ready to go. So I used the nginx access control feature to accomplish it.