特拉菲克没有做我想要的

时间:2019-08-14 12:02:51

标签: docker-compose reverse-proxy traefik

在过去的三天内,我一直在尝试获取Traefik v1.7(我曾短暂尝试过v2,但这是另一个故事)。

我已经数不清我已经编写,重写和更正了多少个docker-compose和traefik.toml文件。据我所知,没有错。

那会发生什么?

当我访问domain1.io时,出现警告,表明浏览器不信任自签名证书。我能理解,但Cloudflare挑战仍然有效... acme文件已包含内容... 而且我也无法访问仪表板,但得到了404。 这是我的docker-compose:

version: "3.7"
services:

traefik:
    image: traefik:latest
    container_name: traefik
    restart: always

    networks:
        - web

    ports:
        - 80:80
        - 443:443
        - 8080:8080

    volumes:
        - /var/run/docker.sock:/var/run/docker.sock:ro
        - /home/dockerunner/docker/traefik/traefik.toml:/traefik.toml
        - /home/dockerunner/docker/traefik/acme.json:/acme.json

domain1web:
    image: domain1web
    container_name: domain1web
    restart: always
    networks:
        - web
        - default
    expose:
        - 9000
    labels:
        - "traefik.docker.network=web"
        - "traefik.enable=true"
        - "traefik.frontend.rule=Host:www.${DOMAINNAME},${DOMAINNAME}"
        - "traefik.basic.port=9000"
        - "traefik.basic.protocol=http"
 networks: web: external: true

traefik.toml ....

defaultEntryPoints = ["http", "https"]

[entryPoints]
[entryPoints.http]
address = ":80"
  [entryPoints.http.redirect]
  entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]

[entryPoints.dashboard]
address = ":8080"
[entryPoints.dashboard.auth]
    [entryPoints.dashboard.auth.basic]
        users = ["master:$apr1$va2Qcey9$1M9Or1Cm.O/vETCYJPh8o0"]
[retry]

[api]
entryPoint = "dashboard"
dashboard = true

[acme]
email = "cloudflare/acme-mail@mail.com"
storage = "traefik/acme.json"
entryPoint = "https"
onHostRule = true
[acme.dnsChallenge]
    provider = "cloudflare"
    delayBeforeCheck = 30
    resolvers = ["1.1.1.1:53"]

    [[acme.domains]]
      main = "domain1.io"
    [[acme.domains]]
      main = "*.domain1.io"
      sans = "domain1.io"
    [[acme.domains]]
      main ="domain2.io"

[docker]
domain = "domain1.io"
watch = true
network = "web"
exposedByDefault = false

请帮助,您是我的最后希望!

0 个答案:

没有答案