@echo off
rem provides nginx startup, restart and shutdown functions under Windows
echo ================ ==begin========================
cls
:: Drive letter where ngxin is located
set NGINX_PATH=E:
: The directory where nginx is located
set NGINX_DIR=E:\service\1\nginx-1.16.0color 0a
TITLE Nginx Management Program Enhanced Edition
br />
CLS
echo.
echo. ** Nginx management program***
echo. *** create 2019-09-10 ***
echo.
:MENU
echo. ***** nginx process list ******
::tasklist|findstr / i "nginx.exe"
tasklist /fi "imagename eq nginx.exe"
echo.
if ERRORLEVEL 1 (
echo nginx.exe Does not exist
) else (
echo nginx.exe exists
)
echo.
::*********** ************************************************** ************************************************
echo.
echo. [1] Start Nginx
echo. [2] Turn off Nginx
echo. [3] Restart Nginx
echo. [4] Refresh the console< br /> echo. [5] Reload Nginx configuration file
echo . [6] Check and test nginx configuration file
echo. [7] Check nginx version
echo. [0] Exit
echo.
echo. Please enter selection Serial number:
set /p ID=
IF "%id%"=="1" GOTO start
IF "%id%"=="2" GOTO stop
IF "%id%"=="3" GOTO restart
IF "%id%"=="4" GOTO MENU
IF "%id%"=="5" GOTO reloadConf
IF "%id%"=="6" GOTO checkConf
IF "%id%"=="7" GOTO showVersion
IF "%id%"=="0" EXIT
PAUSE
::************************************** ************************************************** *********************
::Start
:start
call :startNginx
GOTO MENU
::Stop
:stop
call :shutdownNginx
GOTO MENU
::Restart
:restart
call: shutdownNginx
call :startNginx
GOTO MENU
::Check test configuration file
:checkConf
call :checkConfNginx
GOTO MENU
::Reload Nginx configuration file
:reloadConf
call :checkConfNginx
call :r eloadConfNginx
GOTO MENU
:: show nginx version
:showVersion
call :showVersionNginx
GOTO MENU
::*********************************************** **************************************
::Bottom layer
: :************************************************* ************************************
:shutdownNginx
echo.
echo.Close Nginx...
taskkill /F /IM nginx.exe> nul
echo.OK, close all nginx processes
goto :eof
< br />:startNginx
echo.
echo. Start Nginx......
IF NOT EXIST "%NGINX_DIR%nginx.exe" (
echo "%NGINX_DIR% nginx.exe "does not exist
goto :eof
)
%NGINX_PATH%
cd "%NGINX_DIR%"
IF EXIST " %NGINX_DIR%nginx.exe" (
echo "start'' nginx.exe"
start "" nginx.exe
)
echo.OK
goto :eof
:checkConfNginx
echo.
echo. check test ng inx configuration file...
IF NOT EXIST "%NGINX_DIR%nginx.exe" (
echo "%NGINX_DIR%nginx.exe" does not exist
goto :eof
)
%NGINX_PATH%
cd "%NGINX_DIR%"
nginx -t -c conf/nginx.conf
goto :eof
::Reload the nginx configuration file
:reloadConfNginx
echo.
echo. Reload the nginx configuration file...
IF NOT EXIST " %NGINX_DIR%nginx.exe" (
echo "%NGINX_DIR%nginx.exe" does not exist
goto :eof
)
%NGINX_PATH%
cd "%NGINX_DIR%"
nginx -s reload
goto :eof
:: show nginx version
:showVersionNginx
echo.
%NGINX_PATH%
cd "%NGINX_DIR%"
nginx -V
goto :eof
Startup, restart, shutdown function under Windows
WordPress database error: [Table 'yf99682.wp_s6mz6tyggq_comments' doesn't exist]SELECT SQL_CALC_FOUND_ROWS wp_s6mz6tyggq_comments.comment_ID FROM wp_s6mz6tyggq_comments WHERE ( comment_approved = '1' ) AND comment_post_ID = 5608 ORDER BY wp_s6mz6tyggq_comments.comment_date_gmt ASC, wp_s6mz6tyggq_comments.comment_ID ASC