Nginx access log:
218. 18. *. *--[10/Sep/2014: 13: 27: 50 + 0800] "POST/index. php? Date = & module = Live & action = getLastVisitsStart & segment = & idSite = 2 & period = day HTTP/1.1 "499 0" http://count.111cn.net/index.php? Module = CoreHome & action = index & idSite = 2 & period = day & date = yesterday "" Mozilla/5.0 (Windows NT 6.3; WOW64; rv: 31.0) gecko/20100101 Firefox/31.0"
218. 18. *. *--[10/Sep/2014: 13: 27: 50 + 0800] "POST/index. php? Date = & module = Annotations & action = getEvolutionIcons & idSite = 2 & period = day & lastN = 30 HTTP/1.1 "499 0" http://count.111cn.net/index.php? Module = CoreHome & action = index & idSite = 2 & period = day & date = yesterday "" Mozilla/5.0 (Windows NT 6.3; WOW64; rv: 31.0) gecko/20100101 Firefox/31.0"
218. 18. *. *--[10/Sep/2014: 13: 27: 50 + 0800] "POST/index. php? Date = & module = Dashboard & action = getAllDashboards & idSite = 2 & period = day HTTP/1.1 "499 0" http://count.111cn.net/index.php? Module = CoreHome & action = index & idSite = 2 & period = day & date = yesterday "" Mozilla/5.0 (Windows NT 6.3; WOW64; rv: 31.0) gecko/20100101 Firefox/31.0"
218. 18. *. *--[10/Sep/2014: 13: 27: 50 + 0800] "POST/index. php? Date = & module = ExampleRssWidget & action = rssPiwik & widget = 1 & idSite = 2 & period = day HTTP/1.1 "499 0" http://count.111cn.net/index.php? Module = CoreHome & action = index & idSite = 2 & period = day & date = yesterday "" Mozilla/5.0 (Windows NT 6.3; WOW64; rv: 31.0) gecko/20100101 Firefox/31.0"
Nginx error code:
[Root @ hz logs] # cd/byrd/tools/nginx-1.7.1
[Root @ hz nginx-1.7.1] # grep 499.-r
./CHANGES: *) Bugfix: zero status code was logged instead of 499 status code;
./CHANGES: with 499 status code.
./CHANGES: *) Change: now the 499 error cocould not be redirected using
. /CHANGES.ru: *) Please refer to the following link for more information: please refer to the following link for more information; there are already too many other
./CHANGES.ru: CHANGES.ru has been released.
. /CHANGES.ru: *) Please refer to the following link for more information: please refer to the following link for more information: 499. when there are too many threads, there are too many threads.
./Src/http/ngx_http_core_module.c: if (err-> status = NGX_ERROR | err-> status = 499 ){
./Src/http/ngx_http_request.h: # define NGX_HTTP_CLIENT_CLOSED_REQUEST 499.
./Src/http/ngx_http_special_response.c: ngx_null_string,/* 499, client has closed connection */
Binary file./objs/nginx matches
[Root @ hz nginx-1.7.1] # grep NGX_HTTP_CLIENT_CLOSED_REQUEST.-r
./Src/http/ngx_http_upstream.c: NGX_HTTP_CLIENT_CLOSED_REQUEST );
./Src/http/ngx_http_upstream.c: NGX_HTTP_CLIENT_CLOSED_REQUEST );
./Src/http/ngx_http_upstream.c: NGX_HTTP_CLIENT_CLOSED_REQUEST );
./Src/http/ngx_http_upstream.c: NGX_HTTP_CLIENT_CLOSED_REQUEST );
./Src/http/ngx_http_upstream.c: NGX_HTTP_CLIENT_CLOSED_REQUEST );
./Src/http/ngx_http_upstream.c: NGX_HTTP_CLIENT_CLOSED_REQUEST );
./Src/http/ngx_http_upstream.c: NGX_HTTP_CLIENT_CLOSED_REQUEST );
./Src/http/ngx_http_upstream.c: NGX_HTTP_CLIENT_CLOSED_REQUEST );
./Src/http/ngx_http_upstream.c: | rc = NGX_HTTP_CLIENT_CLOSED_REQUEST)
./Src/http/ngx_http_request.h: # define NGX_HTTP_CLIENT_CLOSED_REQUEST 499.
./Src/http/ngx_http_request.c: | rc = NGX_HTTP_CLIENT_CLOSED_REQUEST
./Src/http/ngx_http_request.c: ngx_http_finalize_request (r, NGX_HTTP_CLIENT_CLOSED_REQUEST );
Cause ①:
If (! U-> cacheable ){
Ngx_http_upstream_finalize_request (r, u,
NGX_HTTP_CLIENT_CLOSED_REQUEST );
}
Cause ②:
If (! U-> cacheable & u-> peer. connection ){
Ngx_log_error (NGX_LOG_INFO, ev-> log, ev-> kq_errno,
"Kevent () reported that client prematurely closed"
"Connection, so upstream connection is closed too ");
Ngx_http_upstream_finalize_request (r, u,
NGX_HTTP_CLIENT_CLOSED_REQUEST );
Return;
}
If (! U-> cacheable & u-> peer. connection ){
Ngx_log_error (NGX_LOG_INFO, ev-> log, err,
"Epoll_wait () reported that client prematurely closed"
"Connection, so upstream connection is closed too ");
Ngx_http_upstream_finalize_request (r, u,
NGX_HTTP_CLIENT_CLOSED_REQUEST );
Return;
}
If (! U-> cacheable & u-> peer. connection ){
Ngx_log_error (NGX_LOG_INFO, ev-> log, err,
"Client prematurely closed connection ,"
"So upstream connection is closed too ");
Ngx_http_upstream_finalize_request (r, u,
NGX_HTTP_CLIENT_CLOSED_REQUEST );
Return;
}
Cause ③:
Ngx_log_error (NGX_LOG_INFO, ev-> log, ev-> kq_errno,
"Kevent () reported that client prematurely closed"
"Connection ");
If (u-> peer. connection = NULL ){
Ngx_http_upstream_finalize_request (r, u,
NGX_HTTP_CLIENT_CLOSED_REQUEST );
}
Ngx_log_error (NGX_LOG_INFO, ev-> log, err,
"Epoll_wait () reported that client prematurely closed"
"Connection ");
If (u-> peer. connection = NULL ){
Ngx_http_upstream_finalize_request (r, u,
NGX_HTTP_CLIENT_CLOSED_REQUEST );
}
Ngx_log_error (NGX_LOG_INFO, ev-> log, err,
"Client prematurely closed connection ");
If (u-> peer. connection = NULL ){
Ngx_http_upstream_finalize_request (r, u,
NGX_HTTP_CLIENT_CLOSED_REQUEST );
}
Cause ④:
If (r-> connection-> error ){
Ngx_http_upstream_finalize_request (r, u,
NGX_HTTP_CLIENT_CLOSED_REQUEST );
Return;
}
Solution:
①: Unsuccessful [solution
Proxy_ignore_client_abort on; # if the client disconnects the request, keep the backend download