I’ve been hosting an EE instance on AWS EC2 for months, and everything has been great. Recently I moved to putting the instance behind a load balancer so that I can access it via HTTPS. The load balancer is listening to port 443, and forwarding the request on port 80 to the EC2 instance.
I can access the site behind TLS (https://gitlab.bescorec.com). But cloning gives “Connection refused” error:
ben ~/tmp $ git clone git@gitlab.bescorec.com:games/gdx/example.git
Cloning into 'example'...
ssh: connect to host gitlab.bescorec.com port 22: Connection refused
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I’ve removed all old SSH keys in GitLab and added my ~/.ssh/id_rsa.pub file to my account’s SSH keys.
I’ve enabled these settings in my gitlab.rb:
nginx['listen_port'] = 80
nginx['listen_https'] = false
nginx['proxy_set_headers'] = {
"X-Forwarded-Proto" => "https",
"X-Forwarded-Ssl" => "on"
}
Anyone have any tips why I might be getting Connection refused after moving from HTTP to HTTPS?
Edit: After posting this question I had the idea to try and do an clone directly to the server, which worked as expected.
git clone git@ec2-34-226-119-254.compute-1.amazonaws.com:games/gdx/example.git
Cloning into 'example'...
remote: Counting objects: 117, done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 117 (delta 19), reused 0 (delta 0)
Receiving objects: 100% (117/117), 14.02 KiB | 3.50 MiB/s, done.
Resolving deltas: 100% (19/19), done.
But I’m still confused why using the DNS behind an ELB forwarding to port 80 isn’t working.