Skip to content

Instantly share code, notes, and snippets.

@brettinternet
Created November 7, 2024 06:38
Show Gist options
  • Save brettinternet/b92a200c385edd7957224b2d62975a74 to your computer and use it in GitHub Desktop.
Save brettinternet/b92a200c385edd7957224b2d62975a74 to your computer and use it in GitHub Desktop.
Traefik routing configuration for pihole - rewrites URL to remove the /admin path
# /etc/traefik/pihole.yaml
http:
middlewares:
pihole-redirectregex:
redirectRegex:
regex: /admin/$
replacement: /
pihole-addprefix:
addPrefix:
prefix: /admin
routers:
pihole:
rule: Host(`pihole.{{ env "MY_DOMAIN" }}`)
service: pihole
entryPoints: [websecure]
middlewares:
- pihole-redirectregex@file
- pihole-addprefix@file
services:
pihole:
loadBalancer:
passHostHeader: true
servers:
- url: http://192.168.1.2/admin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment