git pull https Received HTTP code 504 from proxy after CONNECT

发布时间 2023-06-19 14:00:32作者: 易先讯

我们在服务器上面git pull codehub代码的时候会遇到Received HTTP code 504 from proxy after CONNECT,这个报错多数是因为代理配置的问题。

 

从以下两个方向进行排查:

 

1. 确认服务器/虚拟机是否配置了全局代理。

 

检查/etc/profile中是否配置了代理:http_proxy和https_proxy。这里的代理是服务器/虚拟机本身的,相当于全局代理。如果配置了则注释掉之后,执行source /etc/profile。

 

这时候还有可能没有生效,可以直接执行:

export http_proxy=

export https_proxy=

 

 

2. 检查git代理。

 

git config -l|grep proxy

 

git config --global --unset-all http.proxy

git config --global --unset-all https.proxy