Gitlab in a subdirectory with apache and passenger

后端 未结 5 1639
北荒
北荒 2021-02-02 17:39

I\'m attempting to set up gitlab so that it is accessible through a subdirectory of an existing apache server, example.com/gitlab, for example. I am trying to use p

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-02 18:10

    An update on user1258056's post :

    On recent releases of Gitlab (I'm using 10.0.3), the proposed solution leads to assets not being loaded (Error 401 : Not Authorized)

    To fix this, add the following lines in /etc/gitlab/gitlab.rb :

    unicorn['port'] = 8081
    gitlab_workhorse['listen_addr'] ="127.0.0.1:8181"
    gitlab_workhorse['listen_network'] = "tcp"
    

    And change /etc/apache2/apache2.conf as follow :

    ProxyPass         /gitlab/assets/ http://127.0.0.1:8181/gitlab/assets/
    ProxyPassReverse  /gitlab/assets/ http://127.0.0.1:8181/gitlab/assets/
    
    ProxyPass         /gitlab/ http://127.0.0.1:8081/gitlab/
    ProxyPassReverse  /gitlab/ http://127.0.0.1:8081/gitlab/
    ProxyPass         /gitlab http://127.0.0.1:8081/gitlab
    ProxyPassReverse  /gitlab http://127.0.0.1:8081/gitlab
    

    This leads to assets request being dispatched to the Workhorse component (port 8181), while other requests go through the usual path (port 8081)

提交回复
热议问题