Windows starts nginx common commands

1 To start nginx on windows
, you can directly double-click nginx.exe to start or save the script below as a bat file and double-click to run it.

d:\dashidan.com\nginx-1.0.2>start nginx

d:\dashidan.com\nginx-1.0.2>nginx.exe
is recommended to use the first one, the second one will keep your cmd window in execution, and you cannot perform other command operations.

Note: replace d:\dashidan.com with your own nginx installation path

2 To stop nginx in windows,
you can directly find the nginx.exe process in the resource manager, click the right key, select end process, or save the script below as nginx_stop.bat file and double-click to run it. You need to change the path of nginx.exe to the nginx installation directory.

d:\dashidan.com\nginx-1.0.2>nginx.exe -s stop
or

d:\dashidan.com\nginx-1.0.2>nginx.exe -s quit
stop is to stop nginx quickly, and may not save relevant information.
quit is to stop nginx in a complete and orderly manner, and save relevant information.
3 Reload Nginx configuration
When the nginx configuration has been modified, but you do not want to restart nginx, you can use the reload command to reload the configuration file.

d:\dashidan.com\nginx-1.0.2>nginx.exe -s reload
4 reopen the log file
The log file can be reopened by nginx.exe -s reopen command.

d:\dashidan.com\nginx-1.0.2>nginx.exe -s reopen
5 View Nginx version
nginx -v View Nginx version number.

d:\dashidan.com\nginx-1.0.2>nginx -v

Guess you like

Origin blog.csdn.net/weixin_48128628/article/details/128972862