Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

log status actually not real status (1 reply)

$
0
0
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

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>