Nginx

如何使用非捆綁的網路伺服器設置 Gitlab-omnibus?

  • April 10, 2018

安裝

  1. 我通過(版本)gitlab上的綜合包安裝了該包;debian 7``7.8.1-omnibus-1_amd64.deb
  2. 按照使用非捆綁的 Web 伺服器中的描述更改設置
  3. 執行重新配置命令:(sudo gitlab-ctl reconfigure完成沒有錯誤)。

Nginx

我沒有nginx’ 這個 gitlab 的配置,除了包可能使用以下/etc/gitlab/gitlab.rb文件創建的內容:

external_url 'http://git.mydomain.fr'
web_server['external_users'] = ['www-data']
nginx['enable'] = false
ci_nginx['enable'] = false

日誌

/var/log/nginx/gitlab_error.log

2015/02/28 14:29:16 [alert] 4137#0: *14738 768 worker_connections are not enough while connecting to upstream, client: x.x.128.194, server: git.mydomain.fr, request: "GET / HTTP/1.0", upstream
: "http://x.x.128.194:80/", host: "git.mydomain.fr"

/var/log/nginx/gitlab_access.log

在 acces.log 中,我收到了數百個請求/

x.x.128.194 - - [28/Feb/2015:14:29:16 +0100] "GET / HTTP/1.0" 500 186 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0"
x.x.128.194 - - [28/Feb/2015:14:29:16 +0100] "GET / HTTP/1.0" 500 186 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0"
x.x.128.194 - - [28/Feb/2015:14:29:16 +0100] "GET / HTTP/1.0" 500 186 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0"x.x.128.194 - - [28/Feb/2015:14:29:16 +0100] "GET / HTTP/1.0" 500 186 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0"
x.x.128.194 - - [28/Feb/2015:14:29:16 +0100] "GET / HTTP/1.0" 500 186 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:37.0) Gecko/20100101 Firefox/37.0"

問題

嘗試使用本地links2或外部聯繫服務時出現錯誤502 Bad Gateway

  • 我需要創建一個自定義的 nginx 配置嗎?

繼續探索,我找到了/var/opt/gitlab/目錄並解決了這個問題:

sudo ln -s /var/opt/gitlab/nginx/conf/gitlab-http.conf /etc/nginx/sites-available/
sudo ln -s /etc/nginx/sites-{available,enabled}/gitlab-http.conf
sudo service nginx reload

至於 gitlab 8,我們不能再符號連結到預設的 gitlab-http.conf,因為當我們設置nginx['enable'] = false.

只需從GitLab 配方儲存庫下載正確的 Web 伺服器配置,並YOUR_SERVER_FQDN使用您的首選域名進行更改。

有關如何使用非捆綁網路伺服器安裝 gitlab的詳細說明,請參見此處。

引用自:https://serverfault.com/questions/672111