504 Gateway Timeout for Azure ASP.NET Core 8 app deployed on linux

273 Views Asked by At

I have a long-running Razor page. I am getting the following response after about 4 minutes:

504.0 GatewayTimeout

I have tried the information here.

I've updated my start up code with

builder.Services.AddRequestTimeouts();

and

app.UseRouting();

I've used the RequestTimeout attribute specifying a time, I've used it with a policy, and I've also tried the DisableRequestTimeout attribute. I've tried these attributes at the page (class) level as well as on the endpoint (method). Nothing seems to have any effect.

What am I missing?

1

There are 1 best solutions below

0
On BEST ANSWER

Are you using Azure to host your application? I had the exact same problem, I tried everything, including pulling out some of what's left of my hair, until I finally found this: https://learn.microsoft.com/en-us/troubleshoot/azure/app-service/web-apps-performance-faqs#why-does-my-request-time-out-after-230-seconds It can't be overridden...