After modifying the nginx configuration file
nginx.conf, if you want to restart nginx for the configuration to take effect.
cmd to enter the nginx installation directory, enter the command:
nginx -s reload,you will get the error:
Error: nginx: [error] CreateFile() "D:\nginx-1.20.1/logs/nginx.pid" failed (2: The system cannot find the file specified)
nginx.pidfile in the logs directory under the nginx installation directory. Under normal circumstances, the
nginx.pidfile is automatically created when nginx is started.
nginx.pid. The pid is actually the original process ID.
nginx.pidis manually deleted. Sometimes in the windows system by double-clicking to start nginx, it may not be able to automatically generate the
nginx.pidfile in the logs directory.
nginx -s reloadcommand as the startup command to avoid this error.
step1: Find the original nginx process (if any) in the task manager and close it, and then use the
cmd command to start nginx
cmd to enter the nginx installation directory
step3: Enter the command
start nginx or
nginx.exe to start nginx
step4: Go to the
/logs directory under the
/nginx directory to see if there is a
nginx.pid file; if not, repeat the 123 operation
nginx.pid has been generated, you can restart normally after modifying the configuration file
nginx -s reload