The cause and solution of Nginx 499 error

Source: Internet
Author: User

Today the system maintenance, found a large number of 499 errors,

499 error

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 */

As you can see, 499 corresponds to "client has closed connection". This is most likely because the server-side processing time is too long, the client "impatient".

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.

But search-related issues have been unable to find a solution, and finally found on Google on the English Forum on the resolution on this error.

Proxy_ignore_client_abort on;

Don ' t know if this is safe.

Say to configure proxy_ignore_client_abort on;

The agent service side does not actively shut down the client connection.

Configuration 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

The cause and solution of Nginx 499 error

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.