В настоящее время я пытаюсь настроить Traefik на моем RPi3 в док-контейнере.На данный момент журналы из контейнера Traefik показывают, что проверка прошла успешно, и сервер ответил сертификатом:
pi@raspberrypi:~/docker $ sudo docker-compose logs -tf --tail="50" traefik
Attaching to traefik
traefik | 2018-05-30T06:59:20.617977807Z legolog: 2018/05/30 06:59:20 [INFO] acme: Registering account for m5@aomosk.com
traefik | 2018-05-30T06:59:21.369400647Z legolog: 2018/05/30 06:59:21 [INFO][*.aomosk.com] acme: Obtaining bundled SAN certificate
traefik | 2018-05-30T06:59:21.389707565Z legolog: 2018/05/30 06:59:21 [INFO][aomosk.com] acme: Obtaining bundled SAN certificate
traefik | 2018-05-30T06:59:22.125375140Z legolog: 2018/05/30 06:59:22 [INFO][*.aomosk.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/aN3AZEq8PTXBTYi73jW-yXvHYVC-5-s9YJzcdlJA-M0
traefik | 2018-05-30T06:59:22.125615035Z legolog: 2018/05/30 06:59:22 [INFO][aomosk.com] acme: Trying to solve DNS-01
traefik | 2018-05-30T06:59:22.236071160Z legolog: 2018/05/30 06:59:22 [INFO][aomosk.com] AuthURL: https://acme-v02.api.letsencrypt.org/acme/authz/Le-deKqprPhYN8kj80DH1cIzcxVuk2TXZa_fKgm2is8
traefik | 2018-05-30T06:59:22.236208295Z legolog: 2018/05/30 06:59:22 [INFO][aomosk.com] acme: Trying to solve DNS-01
traefik | 2018-05-30T06:59:22.847749525Z legolog: 2018/05/30 06:59:22 [INFO][aomosk.com] Checking DNS record propagation using [127.0.0.11:53]
traefik | 2018-05-30T06:59:22.908593248Z legolog: 2018/05/30 06:59:22 [INFO][aomosk.com] Checking DNS record propagation using [127.0.0.11:53]
traefik | 2018-05-30T06:59:32.932664129Z legolog: 2018/05/30 06:59:32 [INFO][aomosk.com] The server validated our request
traefik | 2018-05-30T06:59:32.953775211Z legolog: 2018/05/30 06:59:32 [INFO][aomosk.com] The server validated our request
traefik | 2018-05-30T06:59:33.186498364Z legolog: 2018/05/30 06:59:33 [INFO][*.aomosk.com] acme: Validations succeeded; requesting certificates
traefik | 2018-05-30T06:59:33.350874848Z 2018/05/30 06:59:33 dns_challenge.go:94: Error cleaning up aomosk.com: Cloudflare API Error
traefik | 2018-05-30T06:59:33.350992816Z Error: 81061: The record does not exist.
traefik | 2018-05-30T06:59:33.351063284Z legolog: 2018/05/30 06:59:33 [INFO][aomosk.com] acme: Validations succeeded; requesting certificates
traefik | 2018-05-30T07:00:53.579052808Z legolog: 2018/05/30 07:00:53 [INFO][*.aomosk.com] Server responded with a certificate.
traefik | 2018-05-30T07:00:59.363610528Z legolog: 2018/05/30 07:00:59 [INFO][aomosk.com] Server responded with a certificate.
Это копия моего файла docker-compose.yml:
version: "3.6"
services:
traefik:
hostname: traefik
image: traefik:latest
container_name: traefik
restart: always
domainname: aomosk.com
networks:
- default
- traefik_proxy
ports:
- "80:80"
- "443:443"
# - "XXXX:8080"
environment:
- CLOUDFLARE_EMAIL=<my_domain_email>
- CLOUDFLARE_API_KEY=<my_cloudflare_api_key>
labels:
- "traefik.enable=true"
- "traefik.backend=traefik"
- "traefik.frontend.rule=Host:traefik.aomosk.com"
# - "traefik.frontend.rule=Host:${DOMAINNAME}; PathPrefixStrip: /traefik"
- "traefik.port=8080"
- "traefik.docker.network=traefik_proxy"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /home/pi/docker/traefik:/etc/traefik
- /home/pi/docker/shared:/shared
networks:
traefik_proxy:
external:
name: traefik_proxy
default:
driver: bridge
~
И это мой файл 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"
# Force HTTPS
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
[file]
directory = "/etc/traefik/rules/"
watch = true
# Let's encrypt configuration
[acme]
email = "<my_domain_email>" #any email id will work
storage="/etc/traefik/acme/acme.json"
entryPoint = "https"
acmeLogging=true
onDemand = false #create certificate when container is created
[acme.dnsChallenge]
provider = "cloudflare"
delayBeforeCheck = 0
[[acme.domains]]
main = "aomosk.com"
[[acme.domains]]
main = "*.aomosk.com"
# Connection to docker host system (docker.sock)
[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "aomosk.com"
watch = true
# This will hide all docker containers that don't have explicitly
# set label to "enable"
exposedbydefault = false
~
Я перенес свой DNS на Cloudflare для лучшей работы с Traefik, и у меня есть запись A для моего внешнего IP, котораяустановлен на мое доменное имя, но я все еще получаю страницу «сервер не найден», когда я пытаюсь получить доступ к веб-интерфейсу через поддомен (и страница 404 не найдена, когда я использую любой другой метод).Я что-то упускаю из-за того, что веб-интерфейс не работает?