log.conf 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #
  2. # 日志格式定义
  3. # https://nginx.org/en/docs/http/ngx_http_log_module.html
  4. #
  5. # 分隔: tab (\t)
  6. # 前缀: 格式版本。格式变化时递增,方便解析
  7. # 备注:
  8. # origin_id
  9. # 请求源的别名,参考 allowed-sites.conf
  10. # ver
  11. # 前端配置的版本,定义于 www/conf.js
  12. # remote_addr
  13. # 用户 IP,目前未考虑 XFF
  14. # level
  15. # 实验中。记录切换状态(首次请求为 1。切换失败再次请求为 0,表示不接受切换)
  16. # switched
  17. # 实验中。记录是否切换到廉价节点(未切换则为空,有切换则记录资源体积大小)
  18. # bodyhash
  19. # 返回内容的 SHA256,用于统计重复内容
  20. # upstream_http_access_control_allow_origin
  21. # 统计支持 cors 的站点,用于加入直接列表
  22. # ref
  23. # 请求 referer,不包括 `https://example.com/-----` 部分
  24. # mode
  25. # 前端 request.mode 属性
  26. # type
  27. # 前端 request.destination 属性
  28. #
  29. log_format log_proxy escape=none
  30. '02 '
  31. '$time_iso8601 $_origin_id $_ver $remote_addr '
  32. '$_level $_switched $upstream_cache_status $request_time '
  33. '$request_length $bytes_sent '
  34. '$request_method $_url $status $_bodyhash $upstream_http_access_control_allow_origin '
  35. '$http_user_agent $_ref $_mode $_type'
  36. ;
  37. log_format log_www escape=none
  38. '01 '
  39. '$time_iso8601 $remote_addr $request_time '
  40. '$request_method $uri $http_host $status '
  41. '$http_user_agent'
  42. ;