nginx - Does nginx bytes_sent and request_length variables include tcp and tls headers?
问题描述
Does nginx bytes_sent and request_length variables include tcp and tls headers?
$bytes_sent : number of bytes sent to a client (1.3.8, 1.2.5)
static ngx_int_t
ngx_http_variable_bytes_sent(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data)
{
u_char *p;
p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
if (p == NULL) {
return NGX_ERROR;
}
v->len = ngx_sprintf(p, "%O", r->connection->sent) - p;
v->valid = 1;
v->no_cacheable = 0;
v->not_found = 0;
v->data = p;
return NGX_OK;
}
$request_length : request length (including request line, header, and request body) (1.3.12, 1.2.7)
static ngx_int_t
ngx_http_variable_request_length(ngx_http_request_t *r,
ngx_http_variable_value_t *v, uintptr_t data)
{
u_char *p;
p = ngx_pnalloc(r->pool, NGX_OFF_T_LEN);
if (p == NULL) {
return NGX_ERROR;
}
v->len = ngx_sprintf(p, "%O", r->request_length) - p;
v->valid = 1;
v->no_cacheable = 0;
v->not_found = 0;
v->data = p;
return NGX_OK;
}
If not, how can one get accurate bytes received from client and bytes sent to client.
解决方案
推荐阅读
- android-studio - 颤振应用栏中不需要的操作按钮
- multilingual - 我正面临 Redux 框架和 qTranslate X 的问题
- postgresql - 关于将 db 头文件添加到我使用 ninja 构建的项目中
- java - Java Array List - 从用户获取值时面临问题,但在不知不觉中程序终止
- json - 从 json 合并两个 map[string]interface{}
- java - java中的文件分割
- php - 如何将字体真棒类放在已经有引导按钮类的数组中
- docker - 部分推出 Kubernetes Pod
- c++ - 为什么当我点击文件结尾时设置了failbit但没有设置eofbit
- javascript - HTML 不使用 JSPDF 转换为 PDF