需要Nginx access_log大小限制

问题描述 投票:0回答:1

ynxβ1.13.0(秒)AS 2012 R2

我想将访问日志的大小限制为10MB。

在Windows nginx 1.13.0上有哪些参数?

windows nginx size access-log
1个回答
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')执行SET t = %% u

如果“%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退出nginx以关闭日志

nginx.exe -s退出

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启动nginx.exe

© www.soinside.com 2019 - 2024. All rights reserved.