【发布时间】:2017-06-30 18:46:11
【问题描述】:
我有几个使用 LetsEncrypt 凭据在 docker 中运行并通过 traefik 路由的网站。 我想使用 LetsEncrypt 和 traefik 在 docker 中运行本地 gitlab-ce。
所以我将它添加到我的 traefik.toml 文件中:
[[acme.domains]]
main = "gitlab.mydomain.com"
这个到 config/gitlab.rb:
external_url "http://gitlab.mydomain.com"
我开始 gitlab:
docker run -d --restart=always \
--hostname gitlab.mydomain.com \
--expose 80 \
--volume /srv/gitlab/config:/etc/gitlab \
--volume /srv/gitlab/data:/var/opt/gitlab \
--volume /var/log/gitlab:/var/log/gitlab \
--label traefik.frontend.rule=Host:gitlab.mydomain.com \
--name gitlab gitlab/gitlab-ce:latest
转到https://gitlab.mydomain.com/ 我获得了一个带有 LetsEncrypt 生成证书的安全站点,但该站点无法加载:
内部服务器错误
当我重新加载页面时,我在docker logs gitlab -f 看到这个:
==> /var/log/gitlab/sshd/current <==
2017-02-12_16:51:31.00446 Bad protocol version identification 'GET / HTTP/1.1' from 172.17.0.8 port 41138
2017-02-12_16:51:31.26238 Bad protocol version identification 'GET /favicon.ico HTTP/1.1' from 172.17.0.8 port 41140
在日志中搜索/error/i,我发现有几件事可能是问题(zruby/gems/2.3.0/gems/redis-3.2.2z 中报告了很多错误)但没有“确凿证据”AFAICT。
最疯狂的是,我运行docker restart gitlab 大约每十次左右(随机),该网站就会完美出现。我一直很想把它搁置一旁,但其中隐藏着疯狂......
我怎样才能让它可靠地出现?或者我怎样才能更完整地调试它?
【问题讨论】:
-
尝试将
http更改为https。是否已调整gitlab.rb以指向正确的证书? -
谢谢 - 我已经尝试过
http和https并已将 gitlab 指向自签名证书,但 gitlab 站点(随机)出现的唯一时间是http.这与 traefik 和 LetsEncrypt 的工作方式相匹配(即使没有启动,gitlab 也会在带有 LetsEncrypt 证书的浏览器工具栏中显示“安全”)。 -
我在 kubernetes 环境中遇到了类似的问题(入口 traefik)。使用
GITLAB_HTTPS=false设置,总是成功,但GITLAB_HTTPS=true永远不会成功。
标签: docker gitlab-omnibus traefik