Traefik https 不完全安全
Traefik https not fully secure
我尝试使用 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 运行 命令:
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"。所以它应该是安全的。
我错过了什么? :/
我终于找到了 GitLab 页面不安全的原因。这是因为 GitLab 使用不安全路径的头像头像 "htttp://picture_address"。
如果它可以帮助遇到同样问题的人:)
我尝试使用 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 运行 命令:
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"。所以它应该是安全的。
我错过了什么? :/
我终于找到了 GitLab 页面不安全的原因。这是因为 GitLab 使用不安全路径的头像头像 "htttp://picture_address"。
如果它可以帮助遇到同样问题的人:)