Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
基于cloudflare和代理的GitLab ssh_Ssh_Gitlab_Cloudflare - Fatal编程技术网

基于cloudflare和代理的GitLab ssh

基于cloudflare和代理的GitLab ssh,ssh,gitlab,cloudflare,Ssh,Gitlab,Cloudflare,我已经在ProxBox中的lxc容器上安装了gitlab 它的工作原理类似于gitlabproxycloudflare 除了SSH clone/push/pull之外,一切都正常,但是,如果我向/ets/hosts(在本地机器或我使用gitlab的任何其他服务器上)添加一个条目,那么我的代理的公共IP和我的gitlab的域名就可以了 proxyVM也是lxc容器。在那里,我只是用一条规则将22端口重定向到gitlabVM -A PREROUTING -d AAA.AAA.AAA.AAA/32 -

我已经在ProxBox中的lxc容器上安装了gitlab

它的工作原理类似于
gitlab
proxy
cloudflare

除了SSH clone/push/pull之外,一切都正常,但是,如果我向
/ets/hosts
(在本地机器或我使用gitlab的任何其他服务器上)添加一个条目,那么我的
代理的公共IP和我的gitlab的域名就可以了

proxy
VM也是lxc容器。在那里,我只是用一条规则将22端口重定向到
gitlab
VM

-A PREROUTING -d AAA.AAA.AAA.AAA/32 -p tcp -m tcp --dport 22 -j DNAT --to-destination 192.168.10.150:22
这适用于
hosts
文件中的条目。但是如果移除,它就不起作用了

错误:

# git pull

ssh: connect to host git.peacedata.su port 22: Network is unreachable
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
2020年4月24日UPD

我发现Cloudflare阻塞了22端口。
我有一些解决办法,但我需要最“漂亮”的解决方案。)

因此,我只是在
/etc/hosts
中添加了直接IP地址,所有这些都很有魅力

关于cloudflare打开的端口及其原因的详细说明,请参见链接:

# git pull

ssh: connect to host git.peacedata.su port 22: Network is unreachable
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.