SSH端口上的AWS Load Balancer Git克隆错误

时间:2018-10-16 17:59:31

标签: amazon-web-services gitlab amazon-elb

摘要

我们创建了一个EC2实例并安装了Gitlab,然后创建了一个应用程序负载均衡器,并通过HTTPS在子域上对其进行了配置,一切正常,创建了一个新的存储库,添加了ssh-keys(如果我们克隆了HTTPS完全可以,但是通过SSH我们无法为该错误克隆它:

`ssh: connect to host gitlab.our.subdomain port 22: Connection refused`

复制步骤

  1. 创建了一个新的EC2并安装了Gitlab
  2. 配置Gitlab:
    • external_url'https://gitlab.our.subdomain/'
    • nginx ['redirect_http_to_https'] = true
    • nginx ['redirect_http_to_https_port'] = 80
    • nginx ['listen_port'] = 80
    • nginx ['listen_https'] = false
    • “ X-Forwarded-Proto” =>“ https”,
    • “ X-Forwarded-Ssl” =>“开启” 3.-设置对EC2和ALB的权限 Captura_de_pantalla_2018-10-16_a_la_s__12.17.27

Captura_de_pantalla_2018-10-16_a_la_s__12.17.19

当前的 bug 行为是什么?

```
git clone git@gitlab.our.subdomain:ucrea/ucrea_portal.git
Cloning into 'ucrea_portal'...
ssh: connect to host gitlab.realhost.cloud port 22: Connection refused
```

预期的正确行为是什么?

通过SSH克隆项目

相关日志

```
git clone git@gitlab.realhost.cloud:ucrea/ucrea_portal.git
Cloning into 'ucrea_portal'...
ssh: connect to host gitlab.our.dubdomain port 22: Connection refused
fatal: Could not read from remote repository.

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

软件包版本的详细信息

发行人ID:Ubuntu 说明:Ubuntu 18.04.1 LTS 发行:18.04 代号:bionic

```
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                         Version                             Architecture                        Description
+++-============================================================-===================================-===================================-==============================================================================================================================
ii  gitlab-ce                                                    11.3.4-ce.0                         amd64                               GitLab Community Edition (including NGINX, Postgres, Redis)
un  gitlab-ee                                                    <none>                              <none>                              (no description available)
```

环境详细信息

  • 操作系统:Ubuntu 18.04.1 LTS
  • 安装目标,删除不正确的值:
    • EC2
    • VM:AWS
    • 其他:应用程序负载平衡器
  • 安装类型,删除不正确的值:
    • 新安装
    • 从11.3.4-ce.0版本升级
    • 其他:11.3.4-ce.0

配置详细信息

  • external_url'https://gitlab.our.subdomain/'
  • nginx ['redirect_http_to_https'] = true
  • nginx ['redirect_http_to_https_port'] = 80
  • nginx ['listen_port'] = 80
  • nginx ['listen_https'] = false
  • “ X-Forwarded-Proto” =>“ https”,
  • “ X-Forwarded-Ssl” =>“开启”

1 个答案:

答案 0 :(得分:2)

@Ulises 使用经典的弹性负载平衡器,允许进入端口80和22具有安全组。