Hello,
I am getting the following error below when I use ratelimit, Traefik version is 2.49, my domain use Namecheap Premium DNS
Error logs in DEBUG mode
time="2021-06-25T22:09:33Z" level=debug msg="mime: no media type" middlewareName=pihole-compress@docker middlewareType=Compress
time="2021-06-25T22:09:33Z" level=error msg="could not insert bucket: ttlSeconds should be >= 0, got -1794967295" middlewareType=RateLimiterType middlewareName=pihole-ratelimit@docker
192.168.50.1 - - [25/Jun/2021:22:09:33 +0000] "GET /admin/ HTTP/2.0" 500 24 "-" "-" 108 "pi-hole-https@docker" "-" 0ms
Here are the labels which I use:
pi-hole:
container_name: pi-hole
image: pihole/pihole:v5.7
hostname: pihole
restart: unless-stopped
# Web panel will be at http://<your pi's ip>:8000 Set your devices or routers DNS to your pi's ip
ports:
- "8000:80/tcp"
- "53:53/tcp"
- "53:53/udp"
environment:
- ServerIP=10.10.50.3
- DNS1='10.10.50.2#5054'
- DNS2=''
- IPv6=false
- TZ=UTC
- DNSMASQ_LISTENING=all
# Replace PASSWORD with a password for the pihole admin panel
- WEBPASSWORD=PASSWORD
networks:
web:
pihole:
ipv4_address: 10.10.50.3
# Config files are bound to /home/pi/pihone on your raspberrypi, if your using a different device other than a raspberry pi change it to somewhere else
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
- './youTube_ads_4_pi-hole/:/root/youTube_ads_4_pi-hole/'
# This is for the pihole container dns you dont need to change it
dns:
- 127.0.0.1
- 1.1.1.1
cap_add:
- NET_ADMIN
labels:
- traefik.enable=true
# Routers
# - traefik.http.routers.pi-hole-http.rule=Host(`pihole.domain.com`)
# - traefik.http.routers.pi-hole-http.entrypoints=http
# - traefik.http.routers.pi-hole-http.middlewares=pihole-redirectscheme
- traefik.http.routers.pi-hole-https.rule=Host(`pihole.domain.com`)
- traefik.http.routers.pi-hole-https.middlewares=pihole-compress,pihole-ratelimit
- traefik.http.routers.pi-hole-https.tls=true
# Compress Middleware
- traefik.http.middlewares.pihole-compress.compress=true
# Rate Limit Middleware
- traefik.http.middlewares.pihole-ratelimit.ratelimit.average=120
- traefik.http.middlewares.pihole-ratelimit.ratelimit.period=1m
# Services
- traefik.http.services.pi-hole-https.loadbalancer.server.port=80
I use static certs by LetsEncrypt
http:
routers:
traefik:
rule: "Host(`traefik.domain.com`)"
service: "api@internal"
middlewares: "auth"
tls:
domains:
- main: "domain.com"
sans:
- "*.domain.com"
- main: "ldomain.com"
sans:
- "*.domain.com"
middlewares:
auth:
basicAuth:
usersFile: "/etc/traefik/usersfile"
tls:
certificates:
- certFile: "/etc/certs/fullchain.pem"
keyFile: "/etc/certs/privkey.pem"