Nginx-Windows上便捷使用

67 阅读1分钟

下载Nginx

nginx: 下载 (p2hp.com) image.png

启动脚本

新建 nginx-start.bat 文件,内容如下(使用自己的nginx文件夹路径):

@echo off
e:
cd C:/soft/nginx-1.22.0
echo "nginx is starting on port 80"
start "" "nginx.exe"
exit

关闭脚本

新建 nginx-stop.bat 文件,内容如下(使用自己的nginx文件夹路径):

@echo off
e:
cd C:/soft/nginx-1.22.0
tasklist | findstr /i "nginx.exe"
echo "nginx is running, stopping..."
rem nginx -s stop
TASKKILL /F /IM nginx.exe /T
echo "stop ok"