Error in K8S: 504 Gateway Time-out Nginx/1.17.8, the Nginx entry controller requests a timeout after 60 seconds
1. Error in K8S: 504 Gateway time-out nginx/1.17.8. The request timeout limit is 60 seconds. as shown in Figure 1
504 Gateway Time-out
nginx/1.17.8
2. Reference URL:https://www.shuijingwanwq.com/2020/02/19/3936/. The relevant parameters have been adjusted to 300 seconds. But still error.
3. Create a new PHP file, running time for more than 120 seconds. curlhttp://127.0.0.1:81/1.phpNo errors were reported. as shown in Figure 2
[root@main-6556cd6b98-jfqc9 public]# curl http://127.0.0.1:81/1.php
1[root@main-6556cd6b98-jfqc9 public]#
4, but curlhttps://morefun.xxx.xxx.cn/1.phpreport an error. as shown in Figure 3
[root@main-6556cd6b98-jfqc9 /]# curl https://morefun.xxx.xxx.cn/1.php
504 Gateway Time-out
504 Gateway Time-out
nginx/1.17.8
[root@main-6556cd6b98-jfqc9 /]#
5. Load balancing in Rancher View/edit YAML. as shown in Figure 4
6. Reference URL:https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/#custom-timeouts. Add 3 lines of Nginx.Ingress related configuration items. as shown in 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. Curlhttps://morefun.xxx.xxx.cn/1.phpNo errors were reported. in line with expectations. The problem in response to 504 in step 1 is also solved. as shown in Figure 6
[root@main-dd5b77685-lxg7c public]# curl https://morefun.xxx.xxx.cn/1.php
1[root@main-dd5b77685-lxg7c public]#





