GitLab listening HTTP behind a reverse proxy listening HTTPS

Problem to solve

My GitLab instance is available behind a reverse proxy.
The request proxy receive HTTPS request and communicate with the GitLab with HTTP.
That is like that :

Internet <==> HTTPS <==> Reverse Proxy <==> HTTP <==> GitLab

I can access to GitLab from Internet on the web application.
But the link given by GitLab in each repository (“Code” button > “Clone with HTTP”) is not a HTTPS link but a HTTP link.
And it is not possible to clone the repository in the Runner because the Runner try to clone by using a HTTP URL.

Configuration

I have configured gitlab.rb like that :

external_url 'http://git.mydomain.com/'
gitlab_rails['trusted_proxies'] = [ '0.0.0.0/0' ]

registry_external_url 'http://register.mydomain.com'
gitlab_rails['registry_path'] = "/var/opt/gitlab/gitlab-rails/shared/registry"
registry['enable'] = true

nginx['redirect_http_to_https'] = true
nginx['redirect_http_to_https_port'] = 80

nginx['proxy_set_headers'] = {
 "X-Forwarded-Proto" => "https",
 "X-Forwarded-Ssl" => "on",
}

registry_nginx['enable'] = true

Versions

  • Self-managed
  • GitLab.com SaaS
  • Dedicated

Versions

  • GitLab Community Edition [v17.5.1]

Thanks for your help.