Running Gitlab on Relative Path

Enable relative URL in GitLab
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



Reference
https://docs.gitlab.com/ee/install/relative_url.html
https://docs.gitlab.com/omnibus/settings/configuration.html