Thank you for reaching out.
I understand you are facing 504 timeout error after 20 seconds for your Azure Application Gateway even when you have increased the default backend timeout setting value to 200 seconds.
Based on your observation above I think the issue can be because of the timeout set at the backend. It will help if you can check if the 504 response was sent out by the backend in this instance. As documented here
If your backend server is IIS, see Default Limits for Web Sites to set the timeout value. Refer to the connectionTimeout
attribute for details. Ensure the connection timeout in IIS matches or does not exceed the timeout set in the backend setting.
nginx
If the backend server is nginx or nginx ingress controller, and if it has upstream servers, ensure the value of nginx:proxy_read_timeout
matches or does not exceed with the timeout set in the backend setting.
You can also take help of Diagnostic logging for Azure Application Gateway and check the Access logs for any error codes received.
Hope this helps! Please let me know if the issue still persists and we gladly continue with our discussion. Thank you!
Please "Accept the answer" if the information helped you. This will help us and others in the community as well.