1.重启nginx
nginx -s reload
启动后记得查看日志
2.查看正在运行的nginx进程
tasklist /fi "imagename eq nginx.exe"
3.杀死进程
taskkill /f /pid 14724 /pid 1375
4.启动nginx
start nginx
5.检查配置文件是否正确(默认)
nginx -t
6.检查指定配置文件是否正确
nginx -t -c path
-c:使用指定的配置文件而不是conf目录下的nginx.conf 。
-t:测试配置文件是否正确,在运行时需要重新加载配置的时候,此命令非常重要,用来检测所修改的配置文件是否有语法错误。
-s:reload 重载
-s:stop 停止