我正在尝试使用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我不知道该怎么解决这个问题。提前谢谢。
发布于 2021-01-21 23:36:23
我会为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。
https://stackoverflow.com/questions/65825730
复制相似问题