How to Solve 504 Gateway Time-Out Errors with Azure Application Gateway
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (179).NET Core  (28).NET MAUI  (214)Angular  (110)ASP.NET  (51)ASP.NET Core  (83)ASP.NET MVC  (90)Azure  (41)Black Friday Deal  (1)Blazor  (226)BoldSign  (15)DocIO  (24)Essential JS 2  (109)Essential Studio  (200)File Formats  (69)Flutter  (133)JavaScript  (226)Microsoft  (120)PDF  (81)Python  (1)React  (105)Streamlit  (1)Succinctly series  (131)Syncfusion  (942)TypeScript  (33)Uno Platform  (3)UWP  (3)Vue  (45)Webinar  (52)Windows Forms  (61)WinUI  (71)WPF  (163)Xamarin  (160)XlsIO  (38)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (9)Business intelligence  (55)Button  (4)C#  (158)Chart  (140)Chart of the week  (54)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (70)Development  (658)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (7)Essential Tools  (14)Excel  (43)Extensions  (22)File Manager  (7)Gantt  (19)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (512)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (54)Security  (4)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (14)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (393)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (614)What's new  (333)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

How to Solve 504 Gateway Time-Out Errors with Azure Application Gateway

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


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. You can explore all of the new features in our Release Notes and the What’s New pages, and even try the new features out for yourself with a free trial.

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 forumsupport portal, or feedback portal. We are always here to assist you.

Related blogs


Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed