log_format json escape=json '{'
'"time":"$time_iso8601",'
'"host":"$remote_addr",'
'"method":"$request_method",'
'"uri":"$request_uri",'
'"status":"$status",'
'"body_bytes":"$body_bytes_sent",'
'"referer":"$http_referer",'
'"ua":"$http_user_agent",'
'"request_time":"$request_time",'
'"respons_time":"$upstream_response_time"'
'}';
$request_time和$upstream_request_time之间的区别
$request_time是指nginx从客户端接收到请求到返回响应所花费的时间,而$upstream_request_time则表示nginx向代理目标(例如应用服务器等)发送请求后,等待响应返回所花费的时间。
换句话说,$request_time大于$upstream_request_time的关系。
标签:响应,time,request,nginx,json,upstream,日志
From: https://www.cnblogs.com/JentZhang/p/18361330