Welcome! Log In Create A New Profile

Advanced

log status actually not real status

August 31, 2016 04:30AM
Nginx would log status to 200 after response header had sent when upstream prematurely closed connection
I think nginx should log status to 502, even though client recv 200

static u_char *
ngx_http_log_status(ngx_http_request_t *r, u_char *buf, ngx_http_log_op_t *op)
{
ngx_uint_t status;

if (r->err_status) {
status = r->err_status;

} else if (r->headers_out.status) {
status = r->headers_out.status;

} else if (r->http_version == NGX_HTTP_VERSION_9) {
status = 9;

} else {
status = 0;
}

return ngx_sprintf(buf, "%03ui", status);
}

r->err_status should be set in this situation
Subject Author Posted

log status actually not real status

crasyangel August 31, 2016 04:30AM

Re: log status actually not real status

Valentin V. Bartenev August 31, 2016 07:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 250
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready