Linux Restart Nginx WebServer Command

www.lautt‮moc.iru‬
Linux Restart Nginx WebServer Command

To restart the Nginx web server on a Linux system, you can use the systemctl command or the service command. The exact command you use will depend on the Linux distribution and the version of Nginx you have installed.

Here are some examples of commands you can use to restart Nginx:

  • On Ubuntu or Debian systems with Nginx installed from the official package repository, you can use the systemctl command:
sudo systemctl restart nginx
  • On CentOS, Fedora, or Red Hat Enterprise Linux systems with Nginx installed from the official package repository, you can use the systemctl command:
sudo systemctl restart nginx
  • On Ubuntu or Debian systems with Nginx installed from source, you can use the service command:
sudo service nginx restart
  • On CentOS, Fedora, or Red Hat Enterprise Linux systems with Nginx installed from source, you can use the service command:
sudo service nginx restart

You may also be able to use the nginx command to restart Nginx on systems where it is installed from source. For example:

sudo nginx -s reload

This command will send a SIGHUP signal to the Nginx process, which will cause it to reload its configuration and gracefully restart.

If you are not sure which command to use, you can try each of these commands in turn until you find one that works. Alternatively, you can check the Nginx documentation or the documentation for your Linux distribution for more information on restarting Nginx.

Created Time:2017-10-30 10:17:37  Author:lautturi