Azure HTTP 504 gateway timeout w/long requests

Liliana Tang 1 Reputation point

I received this message while trying to run the web app I deployed. Could you please look into this?

Thanks so much!

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,327 questions
0 comments No comments
{count} votes

4 answers

Sort by: Most helpful
  1. T. Kujala 8,706 Reputation points

  2. SnehaAgrawal-MSFT 20,241 Reputation points

    Thanks for reply! You may want to investigate this documentation Enable diagnostics logging for web apps in Azure App Service to analyze the logs to fetch more details on the issue.

    Possible reasons for this ; You might have a request that takes 2-3 minutes to complete. If you check your diagnostic logfile and see this info. "The specified CGI application encountered an error and the server terminated the process". Then you can fix this by going into your web.config in your sites/wwwroot folder and adding a requestTimeout="00:20:00 to the file.

    You may also want to know, the maxRequestLength indicates the maximum file upload size supported by ASP.NET, the maxAllowedContentLength specifies the maximum length of content in a request supported by IIS. Hence, you need to set both maxRequestLength and maxAllowedContentLength values appropriately to upload large files.

    You may refer the approach outlined in these blogs and see if that helps.

    Uploading Large Files to Azure Web Apps
    Troubleshooting – IIS RequestFiltering

    As mentioned in this article maxAllowedContentLength has type uint, checkout the Configuration attributes.

    Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you.

    0 comments No comments

  3. Liliana Tang 1 Reputation point

    @SnehaAgrawal-MSFT Thank for the recommendation. You may be referring to Windows environment? We are having issues with the root of the site we have deployed. It is a Django running in Linux environment. When we access site/admin or site/api, they both work. However, if we just navigate to the main site, it gave us a server error. Any other suggestions?

  4. SnehaAgrawal-MSFT 20,241 Reputation points

    The Resolution of above issue is updated below:

    1. The Versions of modules on requirement.txt were outdated.
    2. Remove the version of all the modules and added the module ‘whitenoise’ to requirements.txt.
    3. The following lines added to // MIDDLEWARE = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] STATICFILES_STORAGE = ''
    4. After these changes the site started to work.
    0 comments No comments