Hi,
It seems to we can't check a request whether used upstream keepalive, so I
add
the following code with an additional variable named $upstream_keepalive.
static ngx_int_t
ngx_http_upstream_keepalive_variable(ngx_http_request_t *r,
ngx_http_variable_value_t *v,
uintptr_t data)
{
if (r->upstream_states == NULL || r->upstream_states->nelts == 0 ||
r->upstream->peer.cached == 0) {
v->data = (u_char *) "0";
} else {
v->data = (u_char *) "1";
}
v->len = 1;
v->valid = 1;
v->no_cacheable = 0;
v->not_found = 0;
return NGX_OK;
}
Help check it, thanks a lot!
B.R.
_______________________________________________
nginx-devel mailing list
[email protected]
http://mailman.nginx.org/mailman/listinfo/nginx-devel