【问题标题】:Traefik Intel NUC LanTraefik 英特尔 NUC 局域网
【发布时间】:2021-01-21 10:45:41
【问题描述】:

我正在尝试将 Traefik 用作家庭网络中英特尔 NUC 的网关。

当我转到 https://nuc.local/traefik 时,我会从 Traefik 而不是仪表板获得 404

这些是来自 traefik docker 容器的日志:

time="2021-01-21T11:45:12+01:00" level=debug msg="Loading ACME certificates [nuc.local]..." providerName=http.acme routerName=traefik-secure rule="Host(`nuc.local`) && PathPrefix(`/traefik`)"
time="2021-01-21T11:45:12+01:00" level=debug msg="Building ACME client..." providerName=http.acme
time="2021-01-21T11:45:12+01:00" level=debug msg="https://acme-v02.api.letsencrypt.org/directory" providerName=http.acme
time="2021-01-21T11:45:13+01:00" level=debug msg="Using HTTP Challenge provider." providerName=http.acme
time="2021-01-21T11:45:13+01:00" level=debug msg="legolog: [INFO] [nuc.local] acme: Obtaining bundled SAN certificate"
time="2021-01-21T11:45:13+01:00" level=error msg="Unable to obtain ACME certificate for domains \"nuc.local\": unable to generate a certificate for the domains [nuc.local]: acme: error: 400 :: POST :: https://acme-v02.api.letsencrypt.org/acme/new-order :: urn:ietf:params:acme:error:rejectedIdentifier :: Error creating new order :: Cannot issue for \"nuc.local\": Domain name does not end with a valid public suffix (TLD), url: " providerName=http.acme routerName=traefik-secure rule="Host(`nuc.local`) && PathPrefix(`/traefik`)"

我的 traefik docker-compose:

version: '3'

services:
  traefik:
    image: traefik:v2.0
    container_name: traefik
    restart: unless-stopped
    security_opt:
      - no-new-privileges:true
    networks:
      - proxy
    ports:
      - 80:80
      - 443:443
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./data/traefik.yml:/traefik.yml:ro
      - ./data/acme.json:/acme.json
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.entrypoints=http"
      - "traefik.http.routers.traefik.rule=Host(`nuc.local`) && PathPrefix(`/traefik`)"
      - "traefik.http.middlewares.traefik-auth.basicauth.users=theo:$$apr1$$7s2uclNV$$FskVZNAeCWKJXRbWRhlL90"
      - "traefik.http.middlewares.traefik-https-redirect.redirectscheme.scheme=https"
      - "traefik.http.routers.traefik.middlewares=traefik-https-redirect"
      - "traefik.http.routers.traefik-secure.entrypoints=https"
      - "traefik.http.routers.traefik-secure.rule=Host(`nuc.local`) && PathPrefix(`/traefik`)"
      - "traefik.http.routers.traefik-secure.middlewares=traefik-auth"
      - "traefik.http.routers.traefik-secure.tls=true"
      - "traefik.http.routers.traefik-secure.tls.certresolver=http"
      - "traefik.http.routers.traefik-secure.service=api@internal"

networks:
  proxy:
    external: true

我的 traefik.yml:

api:
  dashboard: true

entryPoints:
  http:
    address: ":80"
  https:
    address: ":443"

log:
  level: "DEBUG"    

providers:
  docker:
    endpoint: "unix:///var/run/docker.sock"
    exposedByDefault: false

certificatesResolvers:
  http:
    acme:
      email: theodcb@pm.me
      storage: acme.json
      httpChallenge:
        entryPoint: http

我不知道如何解决这个问题。提前致谢。

【问题讨论】:

    标签: traefik


    【解决方案1】:

    我会为 traefik 添加另一个入口点。例如,在您的 traefik.yml 中尝试以下操作:

    api:
      dashboard: true
      entryPoint = "api"
    
    entryPoints:
      http:
        address: ":80"
      https:
        address: ":443"
      api:
        address: ":8080"
    

    确保 docker 容器上的 8080 端口已打开:

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

    然后在浏览器中转到 :8080

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-02-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-20
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多