3 Commands to stop Nginx Server

If you have an up and running Nginx server on your device and want to stop it, lets see some of the ways you can stop it,

  1. Using systemctl command:
    # systemctl stop nginx
    # sudo systemctl stop nginx
  2. Using service command:
    # service stop nginx
    * Stopping nginx nginx [OK]
    # sudo service stop nginx
  3. Using nginx stop command:
    # nginx -s stopx
    # sudo service nginx -s stop

    Note if the service is already stopped, you would see the below message, else the command will return to the prompt.

    # nginx -s stop
    nginx: [error] open() "/run/nginx.pid" failed (2: No such file or directory)
Stop nginx server command
Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap