How do we change the URL of a working GitLab install?

前端 未结 4 2056
时光说笑
时光说笑 2020-11-30 17:41

I have set up and we are running a default install of GitLab v6.0.1 (we\'re about to upgrade as well). It was a \"Production\" setup, following this guide precisely to the l

4条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-30 18:09

    There are detailed notes on this that helped me completely, located here.

    Jonathon Reinhart has already answered with the key bit, to edit /etc/gitlab/gitlab.rb, alter the external_url and then run sudo gitlab-ctl reconfigure; sudo gitlab-ctl restart

    However I needed to go a bit further and docs I linked above explained it. So what I ended up with looks like:

    external_url 'https://gitlab.toilethumor.com'
    nginx['ssl_certificate'] = "/www/ssl/star_toilethumor.com-chained.crt"
    nginx['ssl_certificate_key'] = "/www/ssl/star_toilethumor.com.key"
    nginx['proxy_set_headers'] = {
     "X-Forwarded-Proto" => "http",
     "CUSTOM_HEADER" => "VALUE"
    }
    

    Above, I've explicitly declared where my SSL goodies are on this server. And that's of course followed by

    sudo gitlab-ctl reconfigure
    sudo gitlab-ctl restart
    

    Also, when you switch the omnibus package to https, the bundled nginx will only serve on port 443. Since all my stuff is reached via reverse proxy, this part was potentially significant.

    As I went through this, I screwed something up and it helpful to find the actual nginx logs, this lead me there:

    sudo gitlab-ctl tail nginx
    

提交回复
热议问题