Gitlab CE는 Dockerised Nginx 역방향 프록시 설정 뒤에 502 잘못된 게이트웨이를 제공합니다.

Gitlab CE는 Dockerised Nginx 역방향 프록시 설정 뒤에 502 잘못된 게이트웨이를 제공합니다.

나는 인기 있는 Dockerised Nginx 역방향 프록시를 따랐습니다.설정내 VPS가 여러 사이트나 앱을 컨테이너화된 방식으로 호스팅하기 위해. 현재는 잘 작동하며 정적 콘텐츠를 제공할 수 있습니다.

지금은 Gitlab을 컨테이너화하여 다시 설정하는 중인데 502 Bad Gateway컨테이너를 시작한 후 URL을 방문하면 오류가 발생하여 계속 실패합니다.

docker-compose.yml:

version: "3"

services:
  gitlab:
    image: gitlab/gitlab-ce:latest
    container_name: gitlab
    restart: unless-stopped
    expose:
      - 80
    hostname: "gitlab.mydomain.com"
    environment:
      VIRTUAL_HOST: gitlab.mydomain.com
      LETSENCRYPT_HOST: gitlab.mydomain.com
      LETSENCRYPT_EMAIL: [email protected]
      GITLAB_OMNIBUS_CONFIG: |
        external_url 'https://gitlab.mydomain.com'
    volumes:
      - /srv/gitlab/config:/etc/gitlab
      - /srv/gitlab/logs:/var/log/gitlab
      - /srv/gitlab/data:/var/opt/gitlab

networks:
  default:
    external:
      name: nginx-proxy

external_url컨테이너에 대한 로그를 확인하면 여기에 전체 로그가 있지만 기본적으로 올바르게 설정되지 않았으며 Chef Intra Client시작되지 않는다고 불평합니다 .

================================================================================
Recipe Compile Error in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb
================================================================================
RuntimeError
------------
GitLab external URL must include a schema and FQDN, e.g. http://gitlab.example.com/
Cookbook Trace:
---------------
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab_rails.rb:105:in `parse_external_url'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab_rails.rb:36:in `parse_variables'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:187:in `block in generate_config'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:185:in `each'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/helpers/settings_helper.rb:185:in `generate_config'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/config.rb:24:in `from_file'
  /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/default.rb:26:in `from_file'
Relevant File Content:
----------------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/libraries/gitlab_rails.rb:

 98:      end
 99:  
100:      def parse_external_url
101:        return unless Gitlab['external_url']
102:  
103:        uri = URI(Gitlab['external_url'].to_s)
104:  
105>>       raise "GitLab external URL must include a schema and FQDN, e.g. http://gitlab.example.com/" unless uri.host
106:  
107:        Gitlab['user']['git_user_email'] ||= "gitlab@#{uri.host}"
108:        Gitlab['gitlab_rails']['gitlab_host'] = uri.host
109:        Gitlab['gitlab_rails']['gitlab_email_from'] ||= "gitlab@#{uri.host}"
110:  
111:        case uri.scheme
112:        when "http"
113:          Gitlab['gitlab_rails']['gitlab_https'] = false
114:          Nginx.parse_proxy_headers('nginx', false)

System Info:
------------
chef_version=15.14.0
platform=ubuntu
platform_version=16.04
ruby=ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
program_name=/opt/gitlab/embedded/bin/chef-client
executable=/opt/gitlab/embedded/bin/chef-client

Running handlers:
Running handlers complete
Chef Infra Client failed. 0 resources updated in 05 seconds
There was an error running gitlab-ctl reconfigure:
GitLab external URL must include a schema and FQDN, e.g. http://gitlab.example.com/
Thank you for using GitLab Docker Image!
Current version: gitlab-ce=13.7.1-ce.0
Configure GitLab for your system by editing /etc/gitlab/gitlab.rb file
And restart this container to reload settings.
To do it use docker exec:
  docker exec -it gitlab vim /etc/gitlab/gitlab.rb
  docker restart gitlab
For a comprehensive list of configuration options please see the Omnibus GitLab readme
https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md
If this container fails to start due to permission problems try to fix it by executing:
  docker exec -it gitlab update-permissions
  docker restart gitlab
Cleaning stale PIDs & sockets
Preparing services...
Starting services...
Configuring GitLab...
/opt/gitlab/embedded/bin/runsvdir-start: line 24: ulimit: pending signals: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 34: ulimit: max user processes: cannot modify limit: Operation not permitted
/opt/gitlab/embedded/bin/runsvdir-start: line 37: /proc/sys/fs/file-max: Read-only file system
Starting Chef Infra Client, version 15.14.0
resolving cookbooks for run list: ["gitlab"]
Synchronizing Cookbooks:
  - gitlab (0.0.1)
  - logrotate (0.0.0)
  - redis (0.1.0)
  - registry (0.1.0)
  - mattermost (0.1.0)
  - postgresql (0.1.0)
  - consul (0.1.0)
  - praefect (0.1.0)
  - package (0.1.0)
  - gitlab-pages (0.1.0)
  - letsencrypt (0.1.0)
  - nginx (0.1.0)
  - runit (5.1.3)
  - acme (4.1.1)
  - monitoring (0.1.0)
  - gitaly (0.1.0)
  - crond (0.1.0)
  - gitlab-kas (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...

gitlab.rb대화형으로 컨테이너에 들어가서 확인했는데 external_url올바르게 설정되었지만 어떤 이유로 알아낼 수 없고 작동하지 않습니다.

관련 정보