When the front-end is based on the Nginx reverse proxy to the back-end interface, the back-end interface response does not time out, and the front-end response timeout is solved
1. The front-end response timeout, the response time is: 1 m 0.06 s. as shown in Figure 1
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>openresty/1.19.9.1</center>
</body>
</html>
2. The response of the back-end interface does not time out, and the response time is: 1 m 5.70 s. as shown in Figure 2
3. Adjust the proxy settings and add 3 timeout-related settings. The default is 60s, all adjusted to 300s.
location /api {
proxy_connect_timeout 300s;
proxy_send_timeout 300s;
proxy_read_timeout 300s;
proxy_pass https://xxx-backend.local/api;
}
4. After restarting Nginx, the front end is requested again in the browser, no timeout. The response time is: 1.4 minutes. as shown in Figure 3


