簡體   English   中英

需要Nginx access_log大小限制

[英]Nginx access_log size limit is needed

nginx v 1.13.0(windows)OS WS 2012 R2

我想將訪問日志的大小限制為10MB。

在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')執行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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM