Nginx HTTP 499 Status Code processing

Source: Internet
Author: User
Tags nginx reverse proxy

1. Preface

In dealing with a customer problem today, a large number of 499 status codes appear in the Nginx access log. The actual scenario is: The customer's domain name through the CNAME resolution to our NGINX reverse proxy cluster up, the customer's Web service is a load balancer to provide access to the external network IP, load balancer behind the hanging of a number of intranet Web site Business Server. The access logs that appear are as follows:

2. Treatment method

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

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".

Test Nginx found that if two commits post too fast will appear 499 of the situation, it appears that Nginx is not a secure connection, actively refused the client connection.

There is a workaround for this error on Google's search for an English forum:
proxy_ignore_client_abort on;
Don ' t know if this is safe.
This means to configure the parameter proxy_ignore_client_abort on;
Indicates that the proxy service side does not primarily actively shut down client connections.

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.

Nginx HTTP 499 Status Code processing

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.