
Ĭheck what the current status of your Nginx web server is with one of the following commands: service nginx status You can reload Nginx by using one of the following commands: service nginx reloadĮxample response: Reloading nginx Server. According to Nginx, reload is defined as "start the new worker process with a new configuration, gracefully shut down old worker processes.". Reload is a bit different from restart in that, again, it is more gracefully. Use one of the following commands to run an Nginx restart: service nginx restartĮxample response: Stopping nginx Server. Restarting Nginx basically performs a stop then a start. To quit Nginx, use one of the following commands: service nginx quit


Quitting Nginx is very similar to stopping it however it does so gracefully which means it will finish serving open connections before shutting down. Therefore, if you want Nginx to stop even faster, you can also use: killall -9 nginx This command can still, however, take some time on busy servers. In order to do so, run one of the following commands: service nginx stopĮxample response: Stopping nginx Server. This will terminate Nginx even if there are open connections. Stopping Nginx will kill all system processes quickly.

If you're using a systemd based version such as Ubuntu Linux 16.04 LTS and above, use systemctl within the command, like so: systemctl start nginxĮxample response: Starting nginx server. Just use the following command: service nginx start Remember, if you aren't a root user, you'll need to sudo each command in order for them to properly work. Reference the following list of popular commands if you ever need a quick reminder on how to use a certain command or what it does. I this guide we're going to go over what these popular Nginx commands are, how to use them, and what each one does. Therefore there are a few important Nginx commands you should be aware of in order to get familiar with the basics of this web server. So whether you're currently using it or not, chances are, if you're a web developer chances are you'll likely come in contact with it at some point.

Nginx is one of the most popular web servers in the world.
