Don't include custom ports when matching domains
I'd like gitlab-pages to support running on custom ports. For example, I'm trying to use 'http://pages.example.com:8080'.
I'm using the Omnibus installer. In my /etc/gitlab/gitlab.rb
I set `pages_external_url "http://pages.example.com:8080".
However, it removes the port from the pages-domain so that when I run gitlab-ctl reconfigure
it sets -pages-domain="pages.example.com"
in /opt/gitlab/sv/gitlab-pages/run
. This is an issue because gitlab-pages needs the pages-domain
to have the port :8080
on the end. Without the port can't match the domains and sends 404 errors.
My first workaround is to edit the run
file to include the port, but gitlab-ctl reconfigure
will keep overwriting the file. So my second workaround is to change gitlab-pages
to strip the port when checking domains. I'm going to submit a merge request for the 2nd workaround.