我正在使用nginx/1.6.0,我想记录upstream_connect_time和upstream_header_time的设置如下:
log_format working_p '$remote_addr - $host [$time_local]\t'
'$request" $status $body_bytes_sent\t'
'"$http_referer" "$http_user_agent"\t'
'rt=$request_time uct="$upstream_connect_time" uht="$upstream_header_time" urt="$upstream_response_time"\t'
'$http_x_forwarded_for ';但我总是犯错误
nginx: [emerg] unknown "upstream_connect_time" variable
test nginx conf fail. please check it first, we won't reload it我怎样才能得到预期的upstream_connect_time?
谢谢
发布于 2021-03-12 08:51:38
如果您查看1.9.1+上的文档,这是可用的。
$upstream_connect_time将时间花在与上游服务器建立连接上(1.9.1);时间以毫秒的分辨率以秒为单位。在SSL的情况下,包括用于握手的时间。几个连接的时间由逗号和冒号分隔,如$upstream_addr变量中的地址。
https://nginx.org/en/docs/http/ngx_http_upstream_module.html#var_upstream_connect_time
https://stackoverflow.com/questions/66596756
复制相似问题