首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Traefik Intel NUC Lan

Traefik Intel NUC Lan
EN

Stack Overflow用户
提问于 2021-01-21 18:45:41
回答 1查看 96关注 0票数 0

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

当我访问https://nuc.local/traefik时,我会从Traefik得到一个404,而不是仪表板。

以下是traefik docker容器中的日志:

代码语言:javascript
复制
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:

代码语言:javascript
复制
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:

代码语言:javascript
复制
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

我不知道该怎么解决这个问题。提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2021-01-21 23:36:23

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

代码语言:javascript
复制
api:
  dashboard: true
  entryPoint = "api"

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

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

代码语言:javascript
复制
ports:
  - 80:80
  - 443:443
  - 8080:8080

然后在浏览器中转到:8080。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65825730

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档