This topic describes how to resolve persistent connection timeouts between a client and a server. This issue can occur for services that are protected by Web Application Firewall (WAF).
Problem description
In some business scenarios, a server requires more than 60 seconds to process a client request. Before the server returns the response, the server does not exchange data with the client.
For example, you upload an Excel file on a web page for the server to process. The server requires approximately 3 minutes to process the data and does not exchange data with the client over HTTP or TCP within 120 seconds. In this case, WAF returns a 504 Gateway Timeout error to the client and terminates the connection.
By default, WAF does not maintain a persistent connection that lasts for more than 120 seconds without data exchange.
Solution
-
Log on to the Web Application Firewall 3.0 console. From the top menu bar, select the resource group and region (Chinese Mainland or Outside Chinese Mainland) for the WAF instance.
-
In the left navigation pane, click Onboarding.
On the CNAME Record tab, find the domain name that you want to manage and click Modify in the Actions column.
In the Configure Forwarding Rule step of the wizard, click Other Advanced Settings. Adjust the Read Connection Timeout Period and Write Connection Timeout Period.
A read connection timeout period or write connection period can range from 1 to 3,600 seconds. The default read connection timeout period or write connection period is 120 seconds.