我按照本指南https://www.smarthomebeginner.com/traefik-reverse-proxy-tutorial-for-docker/ 我启动了 traefik,但在日志中我收到以下错误:
“无法为域“mydomain.net”获取 ACME 证书:无法为域 [mydomain.net] 生成证书:acme:错误 -> 一个或多个域出现问题:\n[mydomain.net]错误呈现令牌:cloudflare:未能创建 TXT 记录:来自 makeRequest 的错误:HTTP 状态 400:内容 \"{\"success\":false,\"errors\":[{\"code\":81057,\" message\":\"记录已经存在。\"}],\"messages\":[],\"result\":null}\"\n",
“无法获取域 \"test.mydomain.net\" 的 ACME 证书:无法为域 [test.mydomain.net] 生成证书:acme:错误 -> 一个或多个域出现问题:\n[ test.mydomain.net] 显示令牌时出错:cloudflare:创建 TXT 记录失败:makeRequest 出错:HTTP 状态 400:内容 \"{\"success\":false,\"errors\":[{\"code\ ":81057,\"message\":\"记录已经存在。\"}],\"messages\":[],\"result\":null}\"\n"
我将 Cloudflare 用于我的动态 DNS,我的 @mydomain.net 指向我的路由器 IP。起初,我认为它无法在 Cloudflare 中创建 txt 记录,但我确实看到了 TXT 记录:_acme-challenge,正在创建中。我错过了什么?
更新:所以我想我越来越近了,没有得到以前的错误,这次我得到了一个不同的错误,如果有人能帮忙的话。不知道发生了什么。
level=error msg="Unable to obtain ACME certificate for domains \"*.mydomain.net\" : unable to generate a certificate for the domains [*.mydomain.net]: acme: Error -> One or more domains had a problem:\n[my domain.net] time limit exceeded: last error: dial udp: lookup (serverhostname). on 127.0.0.11:53: server misbehaving\n"
下面是我的 Traefik.toml 配置
#debug = true
logLevel = "ERROR" #DEBUG, INFO, WARN, ERROR, FATAL, PANIC
InsecureSkipVerify = true
defaultEntryPoints = ["https", "http"]
# WEB interface of Traefik - it will show web page with overview of frontend and backend configurations
#[web]
#address = ":8080"
# [web.auth.basic]
# usersFile = "/shared/.htpasswd"
[api]
entryPoint = "traefik"
dashboard = true
address = ":8080"
usersFile = "/shared/.htpasswd"
# Force HTTPS
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
# [entryPoints.https.auth.basic]
# usersFile = "/shared/.htpasswd"
[entryPoints.https.tls]
[file]
directory = "/etc/traefik/rules/"
watch = true
# Enable more detailed statistics.
[web.statistics]
# Number of recent errors logged.
recentErrors = 10
# Let's encrypt configuration
[acme]
email = "myemail address"
storage="/etc/traefik/acme/acme.json"
entryPoint = "https"
acmeLogging=true
onDemand = false #create certificate when container is created
#onHostRule = true #disable for wildcard domains
# Use a HTTP-01 acme challenge rather than TLS-SNI-01 challenge
#[acme.httpChallenge] #does not work with wildcard domains, use dns challenge
# entryPoint = "http" #does not work with wildcard domains
[acme.dnsChallenge]
provider = "cloudflare"
delayBeforeCheck = 0
[[acme.domains]]
main = "mydomain.net"
[[acme.domains]]
main = "*.mydomain.net"
# Connection to docker host system (docker.sock)
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "mydomain.net"
watch = true
# This will hide all docker containers that don't have explicitly
# set label to "enable"
exposedbydefault = false
谢谢