首页 文章

Traefik https不完全安全

提问于
浏览
1

我尝试使用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” . 所以它应该是安全的 .

我错过了什么? :/

1 回答

  • 2

    我终于找到了为什么GitLab页面不安全 . 这是因为GitLab使用不安全路径的头像 Profiles 图片作为“htttp:// picture_address” .

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

相关问题