Gitlab Pages: Custom domain when also using registry

Hi, we are running Gitlab with registry and pages enabled. I've now tried to set up custom pages by using a second IP address following its documentation. I found two issues that I could not find any documentation on and that I had to fix manually, i.e. I was unable to configure it through our gitlab.rb file.

  1. When setting the parameters as explained, I tried to hard-code to our instance's SSL-cert resp. the path to the key which we re-use for our "main" instance, our registry and our pages domain (wildcard). This failed because the /var/opt/gitlab/gitlab-pages/gitlab-pages-config file line root-key was still pointing to the "path/to/pages-domain.key" file which does not exist (we re-use the "path/to/gitlab-domain.key"). Manually changing the line fixed it but this is not a good solution - it should use the parameter set in the gitlab.rb file (i.e. the gitlab_pages['cert'] parameter).

  2. After fixing that I noticed that gitlab-pages could not start as something (nginx) was already listening on that port. After some digging I noticed that the registry was listening on *:443 (file: /var/opt/gitlab/nginx/conf/gitlab-registry.conf). I naively tried re-using the parameter like registry_nginx["external_http"] (and also https) as gitlab_pages offers. This did not work. Again, I had to manually edit the nginx registry-conf-file and manually set the line to listen <primary_ip>:443.

I wonder if there is a simple solution to those in the gitlab.rb file or if there is something not working as intended. In both cases I would suggest to add the steps to the documentation page for custom gitlab pages domains.

EDIT: The second was an easy fix: The necessary parameter is registry_nginx['listen_addresses'] = ['<primary_ip'] (probably similar for ipv6, not tested). So, I guess the issue is only with the 1. and with the missing documentation.

Edited by famfop