nginx12日誌配置

nginx日誌配置:
1.http下:
log_format  main  '遠程地址[$remote_addr]訪問時間[$time_local]狀態[$status]結果大小[$body_bytes_sent]請求路徑[$request]實際請求[$upstream_addr]請求總時間[$request_time]';

2.server下配置日誌按照日期分割

if ($time_iso8601 ~ "^(\d{4})-(\d{2})-(\d{2})") {
            set $year $1;
            set $month $2;
            set $day $3;
        }
access_log  /usr/local/nginx/logs/access_$year-$month-$day.log  main;

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章