在Windows系统中,可以使用批处理脚本来启动和停止Nginx服务器。下面是一个示例脚本:

启动Nginx:

@echo off
echo Starting Nginx...
START /B C:\path\to\nginx.exe
echo Nginx started.

停止Nginx:

@echo off
echo Stopping Nginx...
TASKKILL /F /IM nginx.exe
echo Nginx stopped.

请注意,需要将C:\path\to\nginx.exe替换为您实际的Nginx可执行文件的路径。另外,如果您将Nginx安装为Windows服务,则可以使用以下命令来启动和停止服务:

启动Nginx服务:

@echo off
echo Starting Nginx service...
NET START nginx
echo Nginx service started.

停止Nginx服务:

@echo off
echo Stopping Nginx service...
NET STOP nginx
echo Nginx service stopped.

同样,需要将nginx替换为您实际的Nginx服务名称

nginx 启动 停止 批处理脚本