Git 错误:请求的 URL 返回错误:访问 http:// 时出现 504 网关超时
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21085607/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Git Error: The requested URL returned error: 504 Gateway Timeout while accessing http://
提问by Matthew Moisen
I am using a VM provisioned by my company's internal cloud (KVM) - RHEL 6.4.
我正在使用由我公司的内部云 (KVM) - RHEL 6.4 提供的 VM。
I am able to clone external repositories from the internet. Yet, I cannot figure out how to clone internal repositories on my company's intranet.
我能够从互联网克隆外部存储库。然而,我不知道如何在我公司的 Intranet 上克隆内部存储库。
At first I didn't set the http_proxy
or https_proxy
and received this error:
起初我没有设置http_proxy
orhttps_proxy
并收到此错误:
error: The requested URL returned error: 401 Authorization Required while accessing http://....
After setting http_proxy
and https_proxy
, I now receive this error after waiting about 60 seconds:
设置http_proxy
and 后https_proxy
,我现在在等待大约 60 秒后收到此错误:
error: The requested URL returned error: 504 Gateway Timeout while accessing http://...
I can clone this repo find from my laptop, just not the VM
我可以从我的笔记本电脑中克隆这个 repo find,而不是虚拟机
Any ideas on where I should look?
关于我应该在哪里看的任何想法?
Thanks.
谢谢。
回答by Muhammad Tariq
use this in .gitconfig file then this problem will resolved.
在 .gitconfig 文件中使用它,那么这个问题将得到解决。
- [http]
proxy = http://127.0.0.1:8087
sslVerify = false
OR
git config --global http.proxy ''
或者
git config --global http.proxy ''
回答by Raniz
The 504 status is most likely because you're trying to access an internal server through the proxy so I don't think you should set the proxy but instead focus on the 401 status since that most likely comes from the server hosting the repositories.
504 状态很可能是因为您试图通过代理访问内部服务器,所以我认为您不应该设置代理,而是关注 401 状态,因为这很可能来自托管存储库的服务器。
Do you have anonymous access to the internal repositories?
Are you cloning them in the same way, i.e. using HTTP on both your laptop and on the server, or are you using SSH on the laptop and HTTP on the server?
Do you have any credentials stored on your laptop?
您是否可以匿名访问内部存储库?
您是否以相同的方式克隆它们,即在您的膝上型电脑和服务器上使用 HTTP,还是在膝上型电脑上使用 SSH 而在服务器上使用 HTTP?
您的笔记本电脑上是否存储了任何凭据?