I have been trying to setup Traefik with local DNS for testing but I can't get it working. Traefik does not rout to the docker container. Does anyone have an idea of what I could be doing wrong?
Going to nginx.home.lan takes me to a pihole 404 page. Which I assume is just what I would get when I go to the IP the DNS record is pointing to.
Traefik is not routing nginx.home.lan to the webserver in the docker container. But looking at the service in the dashboard it is routing to 172.26.0.3:80.
nslookup
user@ubuntu:~$ nslookup nginx.home.lan
Server: 127.0.0.53
Address: 127.0.0.53#53
Non-authoritative answer:
Name: nginx.home.lan
Address: 10.237.1.122
docker-compose.yml
version: '3'
services:
traefik-test:
image: "traefik:v2.7"
container_name: "traefik-test"
networks:
- test-proxy
ports:
- "3150:80"
- "443:443"
- "8080:8080"
volumes:
- ./config/traefik.yml:/etc/traefik/traefik.yml
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./acme/acme.json:/acme.json
nginx:
image: nginx:latest
container_name: "nginx"
networks:
- test-proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.nginx.entrypoints=web"
- "traefik.http.routers.nginx.rule=Host(`nginx.home.lan`)"
networks:
test-proxy:
external: true
traefik.yml
global:
checkNewVersion: true
sendAnonymousUsage: false
api:
dashboard: true
insecure: true
entryPoints:
web:
address: :80
websecure:
address: :443
certificatesResolvers:
staging:
acme:
email: -
storage: acme.json
caServer: "https://acme-staging-v02.api.letsencrypt.org/directory"
httpChallenge:
entryPoint: web
production:
acme:
email: -
storage: acme.json
caServer: "https://acme-v02.api.letsencrypt.org/directory"
httpChallenge:
entryPoint: web
providers:
docker:
exposedByDefault: false
file:
directory: /etc/traefik
watch: true