我正在尝试使用以下设置运行gitlab:
我尝试了很多不同的配置,但我仍然无法在代理后面正确运行它。似乎gitlab忽略了相对路径。根据{{3}},这应该有效。 我还尝试了旧的环境选项GITLAB_RELATIVE_URL_ROOT:'/ git',但它没有改变任何东西。
docker-compose.yml看起来像这样:
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'myhostname'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url = 'https://my.domain.com/git'
gitlab_rails['lfs_enabled'] = true
nginx['listen_port'] = 80
nginx['listen_https'] = false
nginx['proxy_set_headers'] = { 'X-Forwarded-Proto' => 'https', 'X-Forwarded-Ssl' => 'on' }
nginx['real_ip_trusted_addresses'] = [ 'proxy-ip', 'host-machine-ip' ]
ports:
- '80:80'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
我在一个单独的机器上运行apache代理,该机器使用let加密来处理SSL。 apache已经运行了很长时间,并且到目前为止所有其他应用程序都能正常运行。其中一些还运行在docker容器中(owncloud,redmine,couchdb,website ...)。
<VirtualHost *:443>
ServerName my-server-name
<IfModule mod_headers.c>
Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains"
</IfModule>
DocumentRoot /var/www/html
ServerAdmin info@my.domain.com
SSLCertificateFile /etc/letsencrypt/live/my.domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/my.domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias my.domain.com
ProxyPreserveHost On
SSLProxyEngine On
RequestHeader set X-FORWARDED-PROTOCOL https
RequestHeader set X-Forwarded-Ssl on
ProxyPass /git http://gitlab-host-ip
ProxyPassReverse /git http://gitlab-host-ip
########## +redirects to other services that look the same as /git
</VirtualHost>