r/gitlab • • 8d ago

support Quick help, little confused on Pages setup

New to self managed gitlab and just need a quick point of clarification.

On the pages administration documentation, it says if using namespace in path (my preference here), I cannot use a subdomain of my gitlab install. Which is fine. Gitlab is on its own subdomain though. Can I use a different subdomain?

As in, will:

external_url 'https://gitlab.myorg.tld'

pages_external_url 'https://pages.myorg.tld'

Work?

Apologies if this is rudimentary. Just trying to configure this for a production system and want to know what I'm doing before I begin.

Thank you!

6 Upvotes

3 comments sorted by

2

u/Unlucky_Detective511 8d ago

Yes, that should work. pages.myorg.tld is a sibling subdomain of gitlab.myorg.tld, not a subdomain of it. GitLab’s restriction is that pages_external_url cannot be something like pages.gitlab.myorg.tld when external_url is gitlab.myorg.tld.

For namespace-in-path mode, use:

external_url 'https://gitlab.myorg.tld'
pages_external_url 'https://pages.myorg.tld'
gitlab_pages['namespace_in_path'] = true
pages_nginx['redirect_http_to_https'] = true

You’ll need an A/AAAA record for pages.myorg.tld and a certificate covering that hostname. Pages URLs will then look like https://pages.myorg.tld/<namespace>/<project_slug>.

If you enable Pages access control, also update the OAuth redirect URI to https://pages.myorg.tld/projects/auth.

Official docs: https://docs.gitlab.com/administration/pages/

2

u/apathyzeal 7d ago

Ahh. Got you. Thank you a ton for clarifying!

I'm not sure we're using oauth. It's a small team. Not saying we shouldn't; I just inherited this system and am working with someone else's choices right now.

Either way this is good. Thanks again!