How to fix 499 on Applixation gateway

Rukhsar Afroz 25 Reputation points
2025-05-06T09:28:40.7166667+00:00

Hi all,

I am getting 499 on Application gateway for some requests for several services. How can we resolve this?

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,187 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Shravan Addagatla 690 Reputation points Microsoft External Staff Moderator
    2025-05-06T10:19:15.42+00:00

    Hello Rukhsar Afroz

    It seems that you're encountering HTTP status code 499 on your Azure Application Gateway, which typically means the client closed the connection before the server could respond. Although HTTP 499 isn't a standard response code (it's specific to Nginx), for Application Gateway, it can also indicate that requests are timing out or being interrupted.
    User's image

    In Application Gateway, user requests will encounter a 502 error if the gateway does not receive a response from the backend within the default timeout period of 20 seconds. However, you set the timeout of BackendHttpSetting to 600 sec, so there will be no issue with timeouts.

    Since you mentioned that only POST requests were seen 499 error from the below logs, so it clearly says that backend itself returns 499 error.

    Container (Ngnix) Log:

    5/6/2025, 8:05:13.000 AM 10.189.48.40 - - [06/May/2025:08:05:00 +0000] "POST /identifier/v1/identifiers HTTP/1.1" 499 0 "-" "Apache-HttpClient/5.4.2 (Java/21.0.6)" 2443 0.000

    Application Gateway Log:

    2025-05-06T08:04:50Z requestUri_s /identifier/v1/identifiers userAgent_s Apache-HttpClient/5.4.2 (Java/21.0.6) httpMethod_s POST clientIP_s 10.191.30.43 clientPort_d 38432 httpStatus_d 499 receivedBytes  2183 timeTaken_d 3.014 serverStatus_s -ServerResponseLatency_s 3.012 AdditionalFields {"contentType":"application/json","error_info":**"ERRORINFO_CLIENT_CLOSED_REQUEST"**clientResponseTime":3.014,"WAFEvaluationTime":"0.000"}

    Here, the issue occurred when the client initially sent a POST request, and the server (nginx) was processing it. Suddenly, the client aborted the connection, causing nginx to throw a 499 error.

    You can try the below configuration on the Ngnix to turn OFF the proxy ignore client aborts the connection and see if it mitigates the 499 errors.

    Syntax: proxy_ignore_client_abort on | off;
    Default: proxy_ignore_client_abort off;
    Context: http, server, location

    Refer these documents:

    https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ignore_client_abort https://stackoverflow.com/questions/12973304/possible-reason-for-nginx-499-error-codes


    I hope this has been helpful!

    Please click "Accept" the answer as original posters help the community find answers faster by identifying the correct answer. 

    If above is unclear and/or you are unsure about something add a comment below, so that we shall address your issue.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.