首页 > 技术文章 > windows 下配置nginx 的脚本

xzqyun 2020-03-17 21:49 原文

start_nginx.bat

@echo off
e:
cd E:\nginx\
echo "nginx is starting on port 80"
start "" "nginx.exe"
exit

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

restart_nginx.bat
@echo off
e:
cd e:\nginx
tasklist | findstr /i "nginx.exe"
echo "nginx is running, stopping..."
rem nginx -s stop
TASKKILL /F /IM nginx.exe /T
echo "stop ok"
start "" "nginx.exe"
exit

推荐阅读