HTTP 499 Status Code nginx 499 error and its solution

Source: Internet
Author: User
Tags nginx server

HTTP 499 Status code nginx under 499 error:


HTTP 499 Status Code nginx under 499 error

499 errors in the HTTP status code in logging there are a number of situations, I encountered a situation is nginx back to a never open back end, so that the log status record is 499, the number of bytes sent is 0.


always have users reflect the site system when bad, because the product on the line is not modified for a long time, so the problem of the front-end program can basically be ruled out, and then think is get the interface of the call is not stable, asked the relevant personnel, said no problem, in order to get the exact evidence, So I asked the relevant personnel to the Nginx server log file (Awstats log), the analysis found that many errors in the log error code 499, about 1% of the entire log file, and it only accounted for the total error of about 70% (all error see), then all the error add up to more than 1%, This volume is still very large.


What is the 499 error? Let's look at the definition of Nginx in the source code:

Ngx_string (Ngx_http_error_495_page),/* 495, HTTPS certificate error */ngx_string (ngx_http_error_496_page),/* 496, HTTPS no certificate */ngx_string (ngx_http_error_497_page),/* 497, HTTP to https */ngx_string (ngx_http_error_404_page) ,/* 498, Canceled */ngx_null_string,/* 499, client has closed connection */


The cause and solution of Nginx 499 error

Open Nginx Access.log found in the last commit is a HTTP1.1 499 0-such error, in Baidu search Nginx 499 error, the result is that the client actively disconnected the connection.

But after my test this is obviously not a client problem, because using the port +ip direct access to the backend server does not exist this problem, and later test Nginx found that if two commits post too fast will appear 499 of the situation, it appears that Nginx is considered to be an insecure connection, actively refused the client connection.


Workaround:

Proxy_ignore_client_abort on; #表示代理服务端不要主要主动关闭客户端连接


With this configuration to restart Nginx, the problem is resolved. Just a slight lack of security, but more than always appear to find the server much better.


Another reason is that I later test found that the client is actually shutting down the connection, or the connection time-out, no matter how many times you set the time-out is useless the PHP process is not enough to improve the number of PHP processes to solve the default test environment to open 5 sub-processes.






This article is from the "Small Ears" blog, please be sure to keep this source http://purify.blog.51cto.com/10572011/1874974

HTTP 499 Status Code nginx 499 error and its solution

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.