1. Error in K8s: 504 Gateway Time-out nginx/1.17.8. The request timeout limit is 60 seconds. See Figure 1.

504 Gateway Time-out
nginx/1.17.8
2. Reference: I had already adjusted the relevant parameters to 300 seconds. However, the error still occurred.
3. Created a new PHP file with an execution time exceeding 120 seconds. Running curl http://127.0.0.1:81/1.php did not produce an error. See Figure 2.

<?php
sleep(120);
echo 1;
exit;
?>
[root@main-6556cd6b98-jfqc9 public]# curl http://127.0.0.1:81/1.php
1[root@main-6556cd6b98-jfqc9 public]#
4. However, running curl https://morefun.xxx.xxx.cn/1.php resulted in an error. See Figure 3.

[root@main-6556cd6b98-jfqc9 /]# curl https://morefun.xxx.xxx.cn/1.php
<html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx/1.17.8</center>
</body>
</html>
[root@main-6556cd6b98-jfqc9 /]# 5. In Rancher, go to Load Balancer to view/edit the YAML. See Figure 4.

6. Reference URL: https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-timeouts . Added 3 lines of nginx.ingress related configuration items. See Figure 5.

nginx.ingress.kubernetes.io/proxy-connect-timeout: "300"
nginx.ingress.kubernetes.io/proxy-read-timeout: "300"
nginx.ingress.kubernetes.io/proxy-send-timeout: "300"
7. Running curl https://morefun.xxx.xxx.cn/1.php did not produce an error. This matches expectations. The 504 response issue from step 1 has also been resolved. See Figure 6.

[root@main-dd5b77685-lxg7c public]# curl https://morefun.xxx.xxx.cn/1.php
1[root@main-dd5b77685-lxg7c public]#
