Close all Nginx processes in Windows

The command to shut down all Nginx processes in Windows and force restart is as follows:

  1. Open Command Prompt (CMD).

  2. Enter the following command to find the PID of the Nginx process:

    tasklist /fi "imagename eq nginx.exe"
    

    This command will list all nginx.exeprocesses named and their PIDs.

  3. Use the following command to kill all Nginx processes (substitute the PID above PID):

    taskkill /pid PID /f
    

    Use this command with the PIDs of all Nginx processes to kill all running Nginx processes. Make sure to use /fthe option to force terminate the process.

  4. Finally, use the following command to restart Nginx:

    start nginx
    

    This command will start a new Nginx process to reload the configuration files and restart the server.

Please note that the above command assumes that Nginx is already configured in the system's PATH environment variable. If not, please provide the correct Nginx installation path, or use the complete path to replace the part in the command nginx.exe.

Guess you like

Origin blog.csdn.net/jieyucx/article/details/134528826