简体   繁体   中英

Nginx access_log size limit is needed

nginx v 1.13.0 (windows) OS WS 2012 R2

I want to limit the size of the access log to 10MB.

What are the parameters for that on Windows nginx 1.13.0?

rem rotate nginx access.log, error.log, rejects.log

CD C:\\nginx

for /f "tokens=1,2" %%u in ('date /t') do SET d=%%v

for /f "tokens=1" %%u in ('time /t') do SET t=%%u

if "%t:~1,1%"==":" SET t=0%t%

SET DATESTR=%d:~6,4%-%d:~0,2%-%d:~3,2%

SET TIMESTR=%t:~0,2%-%t:~3,2%

rem quit nginx to close the logs

nginx.exe -s quit

CD C:\\nginx\\logs\\

IF EXIST access.log ( MOVE access.log access_closed_%DATESTR%%TIMESTR%.log )

IF EXIST error.log ( MOVE error.log error_closed_%DATESTR%%TIMESTR%.log )

IF EXIST rejects.log ( MOVE rejects.log rejects_closed_%DATESTR%%TIMESTR%.log )

CD C:\\nginx start nginx.exe

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM