在 GitLab开启相对URL

2018-09-12  本文已影响0人  Mlotjve

Follow the steps below to enable relative URL in GitLab:

  1. (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
    
    
  2. 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.

  3. Reconfigure GitLab for the changes to take effect:

    sudo gitlab-ctl reconfigure
    
    
  4. 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.

上一篇下一篇

猜你喜欢

热点阅读