Follow the steps below to enable relative URL in GitLab:
-
(Optional) If you run short on resources, you can temporarily free up some memory by shutting down Unicorn and Sidekiq with the following command:
sudo gitlab-ctl stop unicorn sudo gitlab-ctl stop sidekiq
-
Set the
external_url
in/etc/gitlab/gitlab.rb
:external_url "https://example.com/gitlab"
In this example, the relative URL under which GitLab will be served will be
/gitlab
. Change it to your liking. -
Reconfigure GitLab for the changes to take effect:
sudo gitlab-ctl reconfigure
-
Restart the services so that Unicorn and Sidekiq picks up the changes
sudo gitlab-ctl restart
If you stumble upon any issues, see the troubleshooting section.
Disable relative URL in GitLab
To disable the relative URL, follow the same steps as above and set up the external_url
to a one that doesn't contain a relative path. You may need to explicitly restart Unicorn after the reconfigure task is done:
sudo gitlab-ctl restart unicorn
If you stumble upon any issues, see the troubleshooting section.
网友评论