Skip to content

Commit a346b7b

Browse files
authored
Merge pull request #233291 from bpanchanms/400-errors-reasons
Added HTTP 4xx reasons
2 parents 4b23638 + 6237eb5 commit a346b7b

File tree

1 file changed

+24
-7
lines changed

1 file changed

+24
-7
lines changed

articles/application-gateway/http-response-codes.md

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ services: application-gateway
55
author: greg-lindsay
66
ms.service: application-gateway
77
ms.topic: troubleshooting
8-
ms.date: 04/19/2022
8+
ms.date: 04/04/2023
99
ms.author: greglin
1010
---
1111

1212
# HTTP response codes in Application Gateway
1313

14-
This article lists some HTTP response codes that can be returned by Azure Application Gateway. Common causes and troubleshooting steps are provided to help you determine the root cause. HTTP response codes can be returned to a client request whether or not a connection was initiated to a backend target.
14+
This article gives reasons on why Azure Application Gateway returns specific HTTP response codes. Common causes and troubleshooting steps are provided to help you determine the root cause of error HTTP Response code. HTTP response codes can be returned to a client request whether or not a connection was initiated to a backend target.
1515

1616
## 3XX response codes (redirection)
1717

@@ -44,6 +44,23 @@ HTTP 400 response codes are commonly observed when:
4444
- Non-HTTP / HTTPS traffic is initiated to an application gateway with an HTTP or HTTPS listener.
4545
- HTTP traffic is initiated to a listener with HTTPS, with no redirection configured.
4646
- Mutual authentication is configured and unable to properly negotiate.
47+
- The request is not compliant to RFC.
48+
49+
Some of the common reasons for the request to be non-compliant to RFC is listed.So review the urls/requests from the clients and ensure it's compliant to RFC.
50+
51+
| Category | Examples |
52+
| ---------- | ---------- |
53+
| Invalid Host in request line | Host containing two colons (example.com:**8090:8080**) |
54+
| Missing Host Header | Request doesn't have Host Header |
55+
| Presence of malformed or illegal character | Reserved characters are **&,!.** Workaround is to percent code it like %& |
56+
| Invalid HTTP version | Get /content.css HTTP/**0.3** |
57+
| Header field name and URI contains non-ASCII Character | GET /**«úü¡»¿**.doc HTTP/1.1 |
58+
| Missing Content Length header for POST request | Self Explanatory |
59+
| Invalid HTTP Method | **GET123** /index.html HTTP/1.1 |
60+
| Duplicate Headers | Authorization:\<base64 encoded content\>,Authorization: \<base64 encoded content\> |
61+
| Invalid value in Content-Length | Content-Length: **abc**,Content-Length: **-10**|
62+
63+
4764

4865
For cases when mutual authentication is configured, several scenarios can lead to an HTTP 400 response being returned the client, such as:
4966
- Client certificate isn't presented, but mutual authentication is enabled.
@@ -58,7 +75,7 @@ For more information about troubleshooting mutual authentication, see [Error cod
5875

5976
#### 403 – Forbidden
6077

61-
HTTP 403 Forbidden is presented when customers are utilizing WAF skus and have WAF configured in Prevention mode. If enabled WAF rulesets or custom deny WAF rules match the characteristics of an inbound request, the client will be presented a 403 forbidden response.
78+
HTTP 403 Forbidden is presented when customers are utilizing WAF skus and have WAF configured in Prevention mode. If enabled WAF rulesets or custom deny WAF rules match the characteristics of an inbound request, the client is presented a 403 forbidden response.
6279

6380
#### 404 – Page not found
6481

@@ -69,11 +86,11 @@ An HTTP 404 response can be returned if a request is sent to an application gate
6986

7087
#### 408 – Request Timeout
7188

72-
An HTTP 408 response can be observed when client requests to the frontend listener of application gateway do not respond back within 60 seconds. This error can be observed due to traffic congestion between on-premises networks and Azure, when traffic is inspected by virtual appliances, or the client itself becomes overwhelmed.
89+
An HTTP 408 response can be observed when client requests to the frontend listener of application gateway don't respond back within 60 seconds. This error can be observed due to traffic congestion between on-premises networks and Azure, when virtual appliance inspects the traffic traffic, or the client itself becomes overwhelmed.
7390

7491
#### 499 – Client closed the connection
7592

76-
An HTTP 499 response is presented if a client request that is sent to application gateways using v2 sku is closed before the server finished responding. This error can be observed when a large response is returned to the client, but the client may have closed or refreshed their browser/application before the server had a chance to finish responding. In application gateways using v1 sku, an HTTP 0 response code may be raised for the client closing the connection before the server has finished responding as well.
93+
An HTTP 499 response is presented if a client request that is sent to application gateways using v2 sku is closed before the server finished responding. This error can be observed in 2 scenarios. First scenario is when a large response is returned to the client and the client may have closed or refreshed their application before the server finished sending the large response. Second scenario is the timeout on the client side is low and does not wait long enough to receive the response from server. In this case it is better to increase the timeout on the client. In application gateways using v1 sku, an HTTP 0 response code may be raised for the client closing the connection before the server has finished responding as well.
7794

7895

7996
## 5XX response codes (server error)
@@ -82,7 +99,7 @@ An HTTP 499 response is presented if a client request that is sent to applicatio
8299

83100
#### 500 – Internal Server Error
84101

85-
Azure Application Gateway shouldn't exhibit 500 response codes. Please open a support request if you see this code, because this issue is an internal error to the service. For information on how to open a support case, see [Create an Azure support request](../azure-portal/supportability/how-to-create-azure-support-request.md).
102+
Azure Application Gateway shouldn't exhibit 500 response codes. Open a support request if you see this code, because this issue is an internal error to the service. For information on how to open a support case, see [Create an Azure support request](../azure-portal/supportability/how-to-create-azure-support-request.md).
86103

87104
#### 502 – Bad Gateway
88105

@@ -98,7 +115,7 @@ For information about scenarios where 502 errors occur, and how to troubleshoot
98115

99116
#### 504 – Gateway timeout
100117

101-
HTTP 504 errors are presented if a request is sent to application gateways using v2 sku, and the backend response time exceeds the time-out value configured in the Backend Setting.
118+
Azure application Gateway V2 SKU sent HTTP 504 errors if the backend response time exceeds the time-out value which is configured in the Backend Setting.
102119

103120
## Next steps
104121

0 commit comments

Comments
 (0)