【问题标题】:Traefik https not fully secureTraefik https 不完全安全
【发布时间】:2018-05-03 12:09:44
【问题描述】:

我尝试使用 Docker 容器使用 Traefik 配置我的服务器。我配置了 Traefik,让它工作,我得到了仪表板页面。问题是我想拥有自己的 GitLab 服务器。我提取了 GitLab docker 映像并创建了一个 docker-compose 文件。

即使 GitLab 容器需要很长时间才能启动,它似乎也可以工作。我可以从 Traefik 仪表板看到 Gitlab 后端。

问题是当我尝试访问 Gitlab 的地址时,我的浏览器(Firefox 和 Chrome)告诉我我的页面并不完全安全。这是确切的错误:

Connection is not secure. Parts of this page are not secure (such as images)

我不知道为什么会出现此错误,我的配置非常基础。

这是我的 Traefik.toml 配置:

defaultEntryPoints = ["http", "https"]

# Web section is for the dashboard interface
[web]
address = ":8080"
  [web.auth.basic]
    users = ["admin:$apr1$TF1rGQz9$OdtHJ15PT6LGWObE4tXuK0"]

# entryPoints section configures the addresses that Traefik and the proxied containers can listen on
[entryPoints]
  [entryPoints.http]
  address = ":80"
    [entryPoints.http.redirect] 
      entryPoint = "https"
  [entryPoints.https]
  address = ":443"
    [entryPoints.https.tls]

# Acme section is for Let's Encrypt configuration
[acme]
email = "email@email.com"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
onDemand = false

[[acme.domains]]
main = "domain.com"

这是我的 docker-compose.yml

version: '3.3'

networks:
   proxy: 
     external: true
   internal:
     external: false

services:
  gitlab:
    image: gitlab/gitlab-ce
    container_name: gitlab
    labels:
        - traefik.backend=gitlab
        - traefik.frontend.rule=Host:git.domain.com
        - traefik.docker.network=proxy
        - traefik.port=80
    networks:
        - internal
        - proxy

这是我的 Traefik 容器的 docker run 命令:

docker run -d \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v $PWD/traefik.toml:/traefik.toml \
  -v $PWD/acme.json:/acme.json \
  -e TZ="Europe/Paris" \
  -p 80:80 \
  -p 443:443 \
  -l traefik.frontend.rule=Host:monitor.domain.com \
  -l traefik.port=8080 \
  --network proxy \
  --name traefik \
  traefik:1.3.6-alpine --docker --logLevel=DEBUG

正如您所见,这是一个非常基本的配置,我不明白为什么我无法获得完全安全的 GitLab 页面。在 acme.json 文件中,我看到了我的主域“domain.com”和我的子域“git.domain.com”。所以它应该是安全的。

我错过了什么? :/

【问题讨论】:

标签: docker https docker-compose gitlab traefik


【解决方案1】:

我终于找到了 GitLab 页面不安全的原因。这是因为 GitLab 使用具有不安全路径的头像个人资料图片作为“htttp://picture_address”。

如果它可以帮助有同样问题的人:)

【讨论】:

  • 如果该图像位于同一域中,则无论如何都应将其重新路由到 https。我注意到我的 drupal 网站也发生了这种情况。
猜你喜欢
  • 1970-01-01
  • 2018-04-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-22
  • 2013-02-03
  • 2017-06-14
相关资源
最近更新 更多