Pages custom_domain_mode not applied
Summary
When configuring GitLab Pages on Omnibus GitLab with a dedicated NGINX (pages_nginx['enable'] = true), the documented setting gitlab_pages['custom_domain_mode'] is not applied to gitlab.yml by gitlab-ctl reconfigure. As a result, administrators cannot enable Pages custom domains via gitlab.rb as documented, and must resort to manual edits to gitlab.yml after each reconfigure.
This was reported by a self-managed Premium customer on Omnibus GitLab 18.5.1, and confirmed by Support.
Current behavior
Given a configuration like:
# /etc/gitlab/gitlab.rb
pages_external_url 'https://pages.example.com'
pages_nginx['enable'] = true # dedicated NGINX for Pages (used for Pages auth)
gitlab_pages['enable'] = true
gitlab_pages['external_http'] = [] # traffic goes via NGINX
gitlab_pages['custom_domain_mode'] = 'http'
After:
sudo gitlab-ctl reconfigure
the generated /var/opt/gitlab/gitlab-rails/etc/gitlab.yml does not contain custom_domain_mode under the pages: configuration:
pages:
enabled: true
# custom_domain_mode: http # ← missing, despite being set in gitlab.rb
Effects:
- Custom domains for Pages remain disabled in the UI (“Support for domains and certificates is disabled…”).
- Setting
gitlab_pages['custom_domain_mode'] = 'http'ingitlab.rbhas no effect ongitlab.yml.
If an administrator instead manually edits /var/opt/gitlab/gitlab-rails/etc/gitlab.yml and adds:
pages:
enabled: true
custom_domain_mode: http
then custom domains work as expected until the next gitlab-ctl reconfigure, which overwrites the manual change.
Expected behavior
-
When
gitlab_pages['custom_domain_mode']is set ingitlab.rb, Omnibus should:- Render the corresponding
pages.custom_domain_modeentry ingitlab.ymlduringgitlab-ctl reconfigure. - Preserve this behavior across subsequent reconfigures and upgrades, without requiring manual edits to
gitlab.yml.
- Render the corresponding
-
This should work when
pages_nginx['enable'] = true, which is currently the recommended/supported way (for the affected customer) to enable Pages authentication via the dedicated NGINX proxy.
Workaround
The current workaround is:
-
Run
gitlab-ctl reconfigureas usual. -
Manually edit
/var/opt/gitlab/gitlab-rails/etc/gitlab.ymland add:pages: enabled: true custom_domain_mode: http -
Restart Rails components:
sudo gitlab-ctl restart puma sudo gitlab-ctl restart sidekiq
Limitations:
- The manual change is overwritten on every
gitlab-ctl reconfigure(including upgrades and other config changes), so it must be re-applied each time. - The customer wants to avoid any configuration changes outside of Omnibus and manage the instance exclusively via
gitlab.rbandgitlab-ctl reconfigure.
Impact
-
A self-managed Premium customer (Omnibus 18.5.1) using Pages with authentication via
pages_nginx['enable'] = truecannot reliably enable Pages custom domains using the documentedgitlab_pages['custom_domain_mode']setting. -
The documentation currently describes this setting as supported in
gitlab.rb, but Omnibus does not apply it, leading to:- Confusing behavior and extended troubleshooting.
- Fragile operational workarounds (manual
gitlab.ymledits). - Reluctance to change infrastructure (e.g., disabling
pages_nginxor introducing a secondary IP) just to work around this gap.
Suspected root cause / historical context
-
The
gitlab_pages['custom_domain_mode']integration appears to have been introduced and then reverted:- GitLab issue describing the broader Pages custom domain behavior:
- GitLab Charts MR adding
customDomainMode(Rails-level config): - Omnibus MR adding
custom_domain_modesupport: - Omnibus MR reverting that change due to deployment issues on GitLab.com:
-
From a self-managed Omnibus perspective:
- The docs describe
gitlab_pages['custom_domain_mode']as a valid setting. - The Omnibus code path that maps this to
pages.custom_domain_modeingitlab.ymlis missing after the revert.
- The docs describe
Proposal
-
Clarify intended support surface
- Confirm whether
gitlab_pages['custom_domain_mode']is intended to be supported for self-managed Omnibus installations, especially withpages_nginx['enable'] = true.
- Confirm whether
-
If supported (preferred)
- Re-introduce or re-implement the mapping from
gitlab_pages['custom_domain_mode']ingitlab.rbtopages.custom_domain_modeingitlab.yml. - Ensure it behaves correctly in at least these configurations:
-
pages_nginx['enable'] = true(dedicated NGINX, Pages auth). -
pages_nginx['enable'] = falsewithgitlab_pages['external_http']/external_https.
-
- Add tests to cover these scenarios and avoid regressions like the prior revert.
- Re-introduce or re-implement the mapping from
-
If not supported (for now)
- Explicitly document that
gitlab_pages['custom_domain_mode']is not applied by Omnibus and is currently unsupported for self-managed Omnibus. - Optionally, have
gitlab-ctl reconfigureemit a clear warning whengitlab_pages['custom_domain_mode']is set but ignored, to avoid silent misconfiguration.
- Explicitly document that
Environment details (from affected deployment)
- GitLab edition: Self-managed Premium
- Install type: Omnibus (Linux package)
- GitLab version: 18.5.1
-
Pages configuration (high level):
-
pages_nginx['enable'] = true(dedicated NGINX, used for Pages auth) gitlab_pages['enable'] = true-
gitlab_pages['custom_domain_mode'] = 'http'(currently ignored by Omnibus)
-
- Source: Internal GitLab Support ticket referencing this behavior (self-managed Omnibus customer)
2. GitLab docs issue draft
Project: gitlab-org/gitlab
Suggested labels:
Category:Pagesdocumentationtype::bugcustomer
Summary
The GitLab Pages administration documentation describes gitlab_pages['custom_domain_mode'] as a supported Omnibus configuration option, but on Omnibus GitLab 18.5.1 this setting is ignored by gitlab-ctl reconfigure when pages_nginx['enable'] = true.
This mismatch between documentation and actual behavior caused confusion for a self-managed Premium customer and required Support to recommend a fragile manual workaround.
Current documentation behavior
On the GitLab Pages admin docs page (for example, in the “Custom domains” section), the docs:
- Mention
gitlab_pages['custom_domain_mode']as a valid configuration option ingitlab.rb. - Do not state any limitation around:
- Omnibus support for this setting, or
- Interactions with
pages_nginx['enable'] = true(dedicated NGINX / Pages auth setups).
Based on this documentation, administrators expect that adding:
gitlab_pages['custom_domain_mode'] = 'http'
to gitlab.rb will result in the equivalent pages.custom_domain_mode entry in gitlab.yml, enabling custom domains.
Actual behavior on Omnibus
On a self-managed Omnibus instance (18.5.1) with:
pages_nginx['enable'] = true
gitlab_pages['enable'] = true
gitlab_pages['custom_domain_mode'] = 'http'
Support confirmed that:
-
gitlab-ctl reconfiguredoes not writecustom_domain_modeinto/var/opt/gitlab/gitlab-rails/etc/gitlab.yml. -
Custom domains remain disabled in the UI.
-
The only way to enable custom domains is to manually edit
gitlab.ymlafter each reconfigure and add:pages: enabled: true custom_domain_mode: http
This is operationally unsafe (changes are overwritten on each reconfigure) and contradicts the documentation’s implication that gitlab_pages['custom_domain_mode'] is supported for Omnibus.
Related implementation history:
- GitLab issue for Pages + custom domains:
- GitLab Charts MR adding
customDomainMode: - Omnibus MR adding
custom_domain_mode: - Omnibus MR reverting that change due to GitLab.com auto-deploy failures:
Net result: the documentation describes a setting that is not currently wired up in Omnibus.
Impact
-
Self-managed Omnibus administrators may:
- Spend time troubleshooting why
gitlab_pages['custom_domain_mode']“does nothing”. - Implement risky manual workarounds (editing
gitlab.ymlafter each reconfigure). - Potentially avoid otherwise-desirable topologies (e.g., keeping
pages_nginx['enable'] = truefor authentication) due to unclear support status.
- Spend time troubleshooting why
-
Support needs to repeatedly explain that the documented configuration is not actually honored by Omnibus in these versions/setups.
Proposal
Short-term (docs fix)
Until the Omnibus behavior is clarified or fixed (see related Omnibus issue):
-
Update the GitLab Pages administration docs section that describes
gitlab_pages['custom_domain_mode']to clearly state:- This setting is not currently applied by the Omnibus GitLab package in versions where the Omnibus MR was reverted.
- On Omnibus, setting
gitlab_pages['custom_domain_mode']ingitlab.rbwill not populatepages.custom_domain_modeingitlab.yml. - As a result, enabling Pages custom domains in Omnibus with
pages_nginx['enable'] = trueis not supported via this setting at the moment.
-
Optionally, add:
- A note that there is an open Omnibus issue tracking implementation of this setting for self-managed Omnibus (link to the new omnibus-gitlab issue once created).
- A warning against manual edits to
gitlab.ymlas a long-term solution (these edits are overwritten on reconfigure and should be treated as a last-resort workaround).
Longer-term (once Omnibus behavior is decided)
-
When Omnibus implements or re-enables support for
gitlab_pages['custom_domain_mode'], update the docs again to:- Specify the minimum GitLab version where it works for Omnibus.
- Clarify any constraints (e.g., behavior with
pages_nginx['enable'] = truevsfalse, required network topology, etc.). - Remove or revise any warnings about the setting being ignored.
References
- Affected deployment: self-managed Omnibus 18.5.1, Pages with
pages_nginx['enable'] = trueand custom domains. - Implementation history and context:
- GitLab issue: gitlab#285089 (closed)
- Charts MR: gitlab-org/charts/gitlab!4275 (merged)
- Omnibus MR (add): !8419 (merged)
- Omnibus MR (revert): !8458 (merged)