NGINX CLI Cheatsheet
This cheatsheet is just for the commands you can run for Nginx and is nothing to do with the configuration files.
Test The Configuration
If you make a change to your configuration and want to check that everything is okay before having the changes take effect, then use this command.
sudo nginx -t
Reload the Configs
The safest way to apply a configuration change when your nginx server is already running. If you messed up your config, the server will just keep running wit the original configuration. Refer here.
sudo nginx -s reload
Restart The Service
sudo service nginx restart
Graceful Shutdown
This will cause nginx to stop accepting new requests and finish serving any that are currently processing before stopping.
nginx -s quit
Fast Shutdown
This will terminate nginx, even in the middle of handling a request.
nginx -s stop
References
First published: 16th August 2018