How to Solve 504 Gateway Time-Out Errors with Azure Application Gateway
Tags: azure, cloud, productivity, tips
Published: 2023-08-08 13:42:49

---
title: How to Solve 504 Gateway Time-Out Errors with Azure Application Gateway
published: true
date: 2023-08-08 10:50:03 UTC
tags: azure, cloud, productivity, tips
canonical_url: https://www.syncfusion.com/blogs/post/solve-504-gateway-time-out-error-azure-gateway.aspx
cover_image: https://dev-to-uploads.s3.amazonaws.com/uploads/articles/25zw6gdufkcljmrnkfln.png
---
When a browser attempts to load a website, a request is typically made to a web server. An HTTP 504 error code is sent to the browser when the request takes too long to complete. This error might be temporary due to heavy traffic to the website, or it might be due to a resource or request taking too much time to load.

One of our previous articles, [8 Common HTTP Error Codes and Their Possible Fixes](https://www.syncfusion.com/blogs/post/8-common-http-error-codes-and-their-possible-fixes.aspx "Blog: 8 Common HTTP Error Codes and Their Possible Fixes"), explains a 504 gateway time-out error, its causes, and possible fixes.

This blog will explain how to resolve a 504 gateway time-out error in Azure Application Gateway (AAG) caused by an application error or performance issues.

## Azure Application Gateway

[As per Microsoft](https://learn.microsoft.com/en-us/azure/application-gateway/overview "Azure Application Gateway"), AAG is a web traffic load balancer enabling us to manage web application traffic. The following features of AAG make it a practical and universally available load balancer:

- Secure sockets layer (SSL/TLS) termination
- Autoscaling
- Web application firewall
- URL-based routing
- Multiple-site hosting
- Redirection
- Connection draining

AAG has proven very useful with the increased usage of Azure resources for applications. Check the AAG [overview documentation](https://learn.microsoft.com/en-us/azure/application-gateway/overview "What is Azure Application Gateway?") for detailed explanations of its other features.

## What does the 504 error look like, and what is its cause?

A user receives a 504 error in their browser when there is a long-running request related to the site accessed or some action that the user has performed in the web application. The issue in the browser looks like this:

![504 Gateway Time-Out Error](https://www.syncfusion.com/blogs/wp-content/uploads/2023/08/504-Gateway-Time-Out-Error.jpg)
_504 Gateway Time-Out Error_

The cause of this error is that AAG has not received a timely response from the application server. The gateway waits for the response, and if it does not receive one within the time-out period, it throws the 504 error.

## How to fix the issue

Since we are concentrating on an issue with the application code, we can address the time-out issue by increasing the AAG request time-out period gradually until we can use the application and perform the request successfully. By default, the AAG request time-out period is 20 seconds.

For example, let’s say we are trying to retrieve data for a data grid control, and it takes 30 seconds to process this request. We get a 504-gateway time-out error because the time-out period is 20 seconds. If we increase the time-out period to 40 seconds, the page will load adequately without any problems.

## Conclusion

Thank you for reading this blog. I hope that you gained a better understanding of why the 504 gateway time-out issue occurs when using Azure Application Gateway, and that you now have the knowledge to solve the problem quickly.

Additionally, I would like to bring to your attention the recent release of [Essential Studio 2023 Volume 2](https://www.syncfusion.com/forums/183035/essential-studio-2023-volume-2-main-release-v22-1-34-is-available-for-download "Essential Studio 2023 Volume 2"). You can explore all of the new features in our [Release Notes](https://help.syncfusion.com/common/essential-studio/release-notes/v22.1.34 "Essential Studio Release Notes") and the [What’s New](https://www.syncfusion.com/products/whatsnew "Essential Studio What’s New") pages, and even try the new features out for yourself with a [free trial](https://www.syncfusion.com/downloads/essential-js2 "Get the free evaluation of the Essential Studio products").

Should you have any further questions, please don’t hesitate to ask. You can leave your inquiries in the comments section below, or reach out to us through our [support forum](https://www.syncfusion.com/forums "Syncfusion Support Forum"), [support portal](https://support.syncfusion.com/ "Syncfusion Support Portal"), or [feedback portal](https://www.syncfusion.com/feedback "Syncfusion Feedback Portal"). We are always here to assist you.

## Related blogs

- [Digital Signature Web Service Using Azure Key Vault and The Syncfusion C# PDF Library](https://www.syncfusion.com/blogs/post/pdf-digital-signature-web-service-using-azure-key-vault-and-csharp-pdf-library.aspx "Blog: Create A PDF Digital Signature Web Service Using Azure Key Vault and The Syncfusion C# PDF Library")
- [Azure Maps as a Source to Syncfusion Maps](https://www.syncfusion.com/blogs/post/azure-maps-as-a-source-to-syncfusion-maps.aspx "Blog: Azure Maps as a Source to Syncfusion Maps")
- [Authenticate the .NET MAUI App with Azure AD](https://www.syncfusion.com/blogs/post/authenticate-the-net-maui-app-with-azure-ad.aspx "Blog: Authenticate the .NET MAUI App with Azure AD")
- [Interview With Azure Maps Using Blazor Succinctly Author Michael Washington](https://www.syncfusion.com/blogs/post/interview-with-azure-maps-using-blazor-succinctly-author-michael-washington.aspx "Blog: Interview With Azure Maps Using Blazor Succinctly Author Michael Washington")