Traefic

Updated: 03 April 2026

Traefik is a reverse proxy that plays really well with Docker (or I guess any Open Container Initiative environment)

This document doesn’t currently serve as a how-to-use-traefik page but simply as a quick reference for some handy stuff

Global Configuration

Logging

User Agent Logging

Traefik Logs & AccessLogs Docs

The Access Log is configured in the traefik.yml or similar file. Here’s an example configuration for ensuring that the User-Agent is in the logs

1
accessLog:
2
filePath: /path/to/logfile/access.log
3
format: json
4
bufferingSize: 100
5
6
fields:
7
headers:
8
names:
9
User-Agent: keep

Middleware

Redirect to HTTPS

Traefik RedirectScheme Docs

You obviously want to use HTTPS wherever possible, the config for this in the middlewares.yml file can be added to http.middlewares:

1
http:
2
middlewares:
3
redirect-to-https:
4
redirectScheme:
5
scheme: https
6
permanent: true

Rate Limiting

Traefik RateLimit Docs

To avoid getting spammed by bots, you may want to implement some rate limiting, you can do this with the rateLimit middleware which can be added to your middlewares.yml file in http.middlewares

1
http:
2
middlewares:
3
general-rate-limit:
4
rateLimit:
5
average: 100
6
period: 1s
7
burst: 200