2012-12-04 59 views
7

我使用它的installation guide安裝gitlab。一切都還好,但是當我在瀏覽器中打開localhost:80時,我看到了這條消息歡迎來到nginx!。我找不到任何有任何錯誤的日誌文件。安裝gitlab,但只有nginx的歡迎頁面顯示

我在VirtualBox中運行Ubuntu。我的/ etc/nginx的/啓用的站點 -/gitlab配置文件讀取:

# GITLAB 
# Maintainer: @randx 
# App Version: 3.0 

upstream gitlab { 
    server unix:/home/gitlab/gitlab/tmp/sockets/gitlab.socket; 
} 

server { 
    listen 192.168.1.1:80;   # e.g., listen 192.168.1.1:80; 
    server_name aridev-VirtualBox;  # e.g., server_name source.example.com; 
    root /home/gitlab/gitlab/public; 

    # individual nginx logs for this gitlab vhost 
    access_log /var/log/nginx/gitlab_access.log; 
    error_log /var/log/nginx/gitlab_error.log; 

    location/{ 
    # serve static files from defined root folder;. 
    # @gitlab is a named location for the upstream fallback, see below 
    try_files $uri $uri/index.html $uri.html @gitlab; 
    } 

    # if a file, which is not found in the root folder is requested, 
    # then the proxy pass the request to the upsteam (gitlab unicorn) 
    location @gitlab { 
    proxy_read_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694 
    proxy_connect_timeout 300; # https://github.com/gitlabhq/gitlabhq/issues/694 
    proxy_redirect  off; 

    proxy_set_header X-Forwarded-Proto $scheme; 
    proxy_set_header Host    $http_host; 
    proxy_set_header X-Real-IP   $remote_addr; 

    proxy_pass http://gitlab; 
    } 
} 
+1

顯得頗爲類似地雷(https://github.com/VonC/compileEverythin克/斑點/主/ nginx的/ nginx.conf.tpl#L80-L118)。您是否正確啓動GitLab服務? (https://開頭github上。com/VonC/compileEverything/blob/master/gitlab/gitlabd) – VonC

+0

你是否設法解決這個問題? – Raffo

+0

沒有抱歉。一個系統管理員從頭開始並在幾天內完成。他發現安裝很痛苦,但與今天相比,這是一個相當舊的版本。 – Synesso

回答

5

nginx documentation說:

Server names are defined using the server_name directive and determine which server block is used for a given request. 

這意味着在你的情況,你有你的瀏覽器,而不是本地主機中輸入aridev-VirtualBox的

爲了得到這個工作,你必須在你的本地Hosts file中輸入aridev-VirtualBox並將它指向你的VirtualBox PC的IP地址。

這將類似於如下:

192.168.1.1 aridev-VirtualBox 
4

我刪除/etc/nginx/sites-enabled/default擺脫這一問題的。

+0

沒有骰子,對不起。在nginx重新啓動後導致「壞的網關」。 – Synesso

+1

這將適用於ubuntu 13.04上從apt-get安裝nginx的人。 – sunnyrjuneja

+1

適用於Ubuntu 13.10 –

1

嘗試以下從/ etc/nginx的/ /也註釋掉你listen線啓用站點,因爲默認暗示行移除默認的網站同時orkoden的建議應該有足夠的。

同時,確保當您更改這些配置,關閉兩個gitlab和nginx的服務,並在第一,其次是nginx的gitlab的順序啓動它們。

0

我的,我改變了這一行:

proxy_pass http://gitlab; 

本:

proxy_pass http://localhost:3000; 

3000是我的麒麟服務器的端口。

而且我在conf文件做了chown root:ngnix,它現在的工作。

1

您的配置文件是正確的。 # /etc/nginx/sites-enabled/gitlab

也許我認爲你gitlab文件鏈接是錯誤的。

所以舉例:

LN-S的/ etc/nginx的/網站可用/默認 的/ etc/nginx的//gitlab

請您檢查默認內容==啓用的網站,你的/ etc啓用站點-/ nginx的//gitlab 內容