处理windows启动nginx 不在当前目录问题.

将nginx.exe文件名修改为nginx_app.exe

新建nginx批处理,即可随意在命令行任意目录中启动/停止/重新加载

@echo off
set old=%cd%
cd /d %~dp0

set cmd="%1"

if %cmd% == "start" (
    start nginx_app.exe
    goto exit
)

if %cmd% == "stop" (
    nginx_app.exe -s stop
    goto exit
)

if %cmd% == "reload" (
    nginx_app.exe -s reload
    goto exit
)

echo 未知命令! 支持 start, stop, reload

:exit
cd /d %old%

 

BOSS

发表评论

PHP Code Snippets Powered By : XYZScripts.com