Hey, first time user trying to set up a simple port 80 reverse proxy to start with, but I’m in a pickle.
I have this traefik configuration:
9 traefik:
10 image: traefik:latest
11 container_name: traefik
12 command:
13 #- "--log.level=DEBUG"
14 - "--api.insecure=true"
15 - "--providers.docker=true"
16 - "--providers.docker.exposedbydefault=false"
17 - "--entryPoints.web.address=:80"
18 ports:
19 - "80:80"
20 - "443:443"
21 - "8080:8080"
22 volumes:
23 - "/var/run/docker.sock:/var/run/docker.sock:ro"
And these are the labels on my pihole service:
52 - traefik.enable=true
53 - traefik.http.routers.pihole.rule=Host(`pihole.MYDOMAIN.XYZ`)
54 - traefik.http.routers.pihole.entrypoints=web
55 - traefik.http.routers.pihole.loadbalancer.server.port=9080
I’m setting it to port 9080 as that’s what I have the internal port 80 on the service routing to. When I don’t include the …server.port= line requests to pihole.MYDOMAIN.XYZ eventually timeout with a bad gateway, logs indicate it’s routing to port 53 (also being served by the container):
DBG github.com/traefik/traefik/v3/pkg/server/service/loadbalancer/wrr/wrr.go:176 > Service selected by WRR: http://172.18.0.3:53
Also not surprising, Traefik Docker Documentation - Traefik documents as such. However, it documents the loadbalancer.server.port as a solution, but when you do that it barfs:
error="field not found, node: loadbalancer"
Not really sure where to go from here on this one, not sure if the documentation is bad or if I hit a bug. Sha is a9890c898f379c1905ee5b28342f6b408dc863f08db2dab20e46c267d1ff463a