7

I have set up a gitlab server and gitlab pages for our company internal gitlab. The configuration was made according to Pages domain with tls support without wildcard dns.

The pages work correctly and i can access the pages over the address https://pages.example.com/group/project as expected.

I was now wondering if there is a way to define the "base" or "root" page for the whole instance. That page would then be served on the address https://pages.example.com.

Currently, when I call https://pages.example.com in my browser it redirects multiple times to https://pages.example.com///////////.

The documentation describes ways of defining group pages but I have not found a way to define a "root" page.

It could also be a redirect to another page. Similar as it is done when you call https://pages.gitlab.io

Thanks for your help!

1

2 Answers 2

2

Followed the same setup as you, noticed this redirect loop.

I fixed it by adding this to my gitlab.rb:

pages_nginx['custom_gitlab_server_config'] = "# Fix redirect loop\n  location ~ ^/$ {\n    return 302 $scheme://$http_host/default/page;\n  }"

Then I ran the command:

gitlab-ctl reconfigure

Change 'default/page' to direct the user to the page you want to be default.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, your solution worked flawlessly.
0

It looks like you have some kind of "trailing slash loop" going on that's not supposed to happen in the first place. Maybe it has to do with some config of your wildcard domain for this, or maybe some generic bad rule for removing trailing slashes.

Anyway, To my knowledge, Gitlab doesn't have a "root" page feature for the gitlab pages, but you can probably redirect to some static page you built elsewere and do a http 302 redirect using your reverse proxy configuration (that's probably what gitlab.com did with their pages).

You can even create this static page with gitlab pages. For example, in a repository you create an "about" gitlab pages (about.pages.example.com) and then redirect https://pages.exemple.com to https://about.pages.exemple.com

1 Comment

Do you have an example or a link on how i could achieve that with the default omnibus deployment? I think it uses nginx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.