nginx PHP499错误,Nginx日志错误码499的问题解决方法

nginx访问日志:

218.18.*.* - - [10/Sep/2014:13:27:50 +0800] "POST /index.php?date=2014-09-09&module=Live&action=getLastVisitsStart&segment=&idSite=2&period=day HTTP/1.1" 499 0 "http://count.111com.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=2014-09-09&module=Annotations&action=getEvolutionIcons&idSite=2&period=day&lastN=30 HTTP/1.1" 499 0 "http://count.111com.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=2014-09-09&module=Dashboard&action=getAllDashboards&idSite=2&period=day HTTP/1.1" 499 0 "http://count.111com.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=2014-09-09&module=ExampleRssWidget&action=rssPiwik&widget=1&idSite=2&period=day HTTP/1.1" 499 0 "http://count.111com.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定义错误码:

[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; the

./CHANGES:       with 499 status code.

./CHANGES:    *) Change: now the 499 error could not be redirected using an

./CHANGES.ru:    *) Исправление: вместо кода ответа 499 в лог записывался код 0; ошибка

./CHANGES.ru:       завершался с кодом 499.

./CHANGES.ru:    *) Изменение: ошибку 499 теперь нельзя перенаправить с помощью директивы

./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);

原因①:

if (!u->cacheable) {

ngx_http_upstream_finalize_request(r, u,

NGX_HTTP_CLIENT_CLOSED_REQUEST);

}

原因②:

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;

}

原因③:

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);

}

原因④:

if (r->connection->error) {

ngx_http_upstream_finalize_request(r, u,

NGX_HTTP_CLIENT_CLOSED_REQUEST);

return;

}

解决方法:

①:未成功[解决方法

proxy_ignore_client_abort on;    #如果客户端断开请求,也保持后端的下载

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值