Traefik redirect with external Pi-Hole

I've got an external Pi-Hole v6 instance that I am having trouble geting to work properly with Traefik v3. Basically I am having the exact same issue as this post.

I've tried the middleware and regex settings as described, but it loads the admin page with an error, if I disable the middleware settings, I get a 403 error, but then I can just click the admin link and its fine.

Figured this out. In case anyone has the same issue, this solved it for me.

http:
routers:
pihole:
entryPoints:
- websecure
rule: "Host(pihole.domain.com)"
service: pihole
tls:
certResolver: letsencrypt
middlewares:
- pihole-redirect

middlewares:
pihole-redirect:
redirectRegex:
permanent: true
regex: "^https://pihole.domain.com/?$"
replacement: "https://pihole.domain.com/admin"

services:
pihole:
loadBalancer:
passHostHeader: true
servers:
- url: "https://pihole IP"

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.