Troubles enabling Container Registry behind Traefik reverse proxy

I have figured it out! I have it working finally and I could not be happier :partying_face:

No need to reconf traefik, just had to get the labels in my gitlab docker compose to be correct.

Now I have this in my GITLAB_OMNIBUS_CONFIG:

        # Container Registry
        #here as a side note; my dns has a *.gitlab wildcard that redirects to the same ip as gitlab.example.com
        registry_external_url 'https://registry.gitlab.example.com' 
        # Enable registry
        registry['enable'] = true
        # Allow registry features in Gitlab UI
        gitlab_rails['registry_enabled'] = true
        # Allow Gitlab's internal NGINX to handle traffic for the registry
        registry_nginx['enable'] = true
        registry_nginx['listen_port'] = 5050
        registry_nginx['listen_https'] = false

and then in my labels I have:

      # Container Registry
      - "traefik.http.routers.registry.rule=Host(`registry.gitlab.example.com`)"
      - "traefik.http.routers.registry.entrypoints=websecure"
      - "traefik.http.routers.registry.tls=true"
      - "traefik.http.routers.registry.tls.certresolver=letsencrypt"
      - "traefik.http.routers.registry.service=registry"
      - "traefik.http.services.registry.loadbalancer.server.port=5050"

I think it was extremely important to have all three registry['enable'] = true, gitlab_rails['registry_enabled'] = true, and registry_nginx['enable'] = true and to undestand what they actually do. Took me a while bit I got there in the end. Hope this might help someone else as I found mupltiple threads about this but no clear answer anywhere as to why people’s configs are not working.

1 Like