基于cloudflare和代理的GitLab ssh
我已经在ProxBox中的lxc容器上安装了gitlab 它的工作原理类似于基于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 -
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.