window 下nginx 应用的启动,停止,重启,进程结束

背景:

在window环境下开发,运行web应用,不想装繁琐的 IIS 服务器,挂网站应用

运行环境

直接官网下载 nginx 解压

任意命令行工具(cmd,powershell,console),切换到带有 nginx.exe 目录,直接敲命令

命令

启动

start nginx

以指定的配置文件启动 nginx

start nginx.exe -c conf/xxxxx.conf

停止

强关: ( 开发就是干,直接关 +.+ )

nginx -s stop 

软关:等待程序关闭,安全关闭nginx

nginx -s quit

重启

针对改了nginx 运行配置 conf 下的东西,使配置生效,web目录(html)文件变动,不需要重启

nginx -s reload

杀进程

针对其他原因造成跑了多个nginx.exe 进程的时候,上面的命令就好使了,那就得将nginx进程全杀掉

taskkill /f /im nginx.exe

打开日志

nginx -s reopen