2016-04-06 15 views
0

Nginxプロキシ(Jwilder、デフォルト設定)とGitlab-Instanceが同じホスト上で動作しています。 git.myhost.comはホストIPを指します。 以下のdocker-compose.ymlでGitlabを起動すると、http://git.myhost.comにアクセスすると502 Bad Gatewayになります。 nginxのプロキシコンテナ内 502 JwilderのNginxプロキシを経由して仮想ホストにアクセスするときの不正なゲートウェイ

生成/etc/nginx/conf.d/default.conf

は、同様に正常に見える:私は間違って何をやっている

upstream git.myhost.com { 
       # 2ab9168d-c69e-4725-8c20-31a194ad8d07 
       server 172.17.0.13 vhost; 
} 
server { 
     server_name git.myhost.com; 
     listen 80 ; 
     access_log /var/log/nginx/access.log vhost; 
     location/{ 
       proxy_pass http://git.myhost.com; 
     } 
} 

はここGitlabのdocker-compose.ymlです:

gitlab-server: 
    hostname: git.myhost.com 
    expose: 
    - "8100" 
    ports: 
    - 8101:22/tcp 
# - 8100:8100/tcp 
    labels: 
    io.rancher.sidekicks: gitlab-data 
    environment: 
    GITLAB_OMNIBUS_CONFIG: | 
     external_url 'http://git.myhost.com' 
     gitlab_rails['gitlab_shell_ssh_port'] = 8101 
    VIRTUAL_HOST: git.myhost.com 
    VIRTUAL_PORT: 8100 
    image: gitlab/gitlab-ce:latest 
    volumes_from: 
    - gitlab-data 

gitlab-data: 
    labels: 
    io.rancher.container.start_once: 'true' 
    entrypoint: 
    - /bin/true 
    hostname: gitdata 
    image: gitlab/gitlab-ce:latest 
    volumes: 
    - /etc/gitlab:/etc/gitlab 
    - /var/log/gitlab:/var/log/gitlab 
    - /var/opt/gitlab:/var/opt/gitlab 

答えて

1

あなたは以下のようにnginxのを変更する必要があります。

upstream gitlab { 
       # 2ab9168d-c69e-4725-8c20-31a194ad8d07 
       server 172.17.0.13:8100; 
} 
server { 
     server_name git.myhost.com; 
     listen 80 ; 
     access_log /var/log/nginx/access.log vhost; 
     location/{ 
       proxy_pass http://gitlab; 
     } 
} 

172.17.0.13をgitlabドッキングウィンドウコンテナのIPアドレスです。

関連する問題