Contact Us
Webflow Premium Partner Ehab Fayez
Back to Agent Skills
DevOps & Infrastructure

Traefik Reverse Proxy

Configure Traefik as a dynamic reverse proxy with automatic service discovery for Docker and Kubernetes environments.

Claude Code Cursor Codex

Overview

Traefik is a cloud-native reverse proxy and load balancer that automatically discovers services from Docker, Kubernetes, and other orchestrators. Unlike Nginx where you manually define upstreams, Traefik watches your container labels and dynamically updates its routing table, making it ideal for microservice architectures that scale up and down frequently.

AI agents can generate Traefik configurations in both YAML and TOML formats, set up Docker labels for automatic service discovery, configure middleware chains for authentication, rate limiting, and circuit breaking, and troubleshoot routing issues by analyzing Traefik's dashboard API. The agent understands the relationship between entrypoints, routers, services, and middleware, producing configurations that follow best practices.

This skill is especially valuable for teams running containerized applications. Your AI agent can configure Traefik as an ingress controller for Docker Compose or Kubernetes, set up automatic Let's Encrypt certificates via the ACME protocol, and implement advanced routing patterns like path-based or header-based routing across multiple services.

Who Is This For?

  • DevOps teams setting up dynamic reverse proxying for Docker Compose stacks
  • Platform engineers configuring Traefik as a Kubernetes ingress controller
  • Developers implementing path-based routing across microservices
  • Teams setting up automatic TLS with Let's Encrypt via Traefik ACME

Installation

Setup for Claude Code
Install Traefik: brew install traefik (macOS) or use Docker image traefik:v3.0
Claude Code generates traefik.yml and Docker labels

Configuration

# docker-compose.yml (Traefik with auto-discovery)
services:
  traefik:
    image: traefik:v3.0
    command:
      - "--providers.docker=true"
      - "--entrypoints.web.address=:80"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.letsencrypt.acme.email=you@example.com"
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
  app:
    image: my-app
    labels:
      - "traefik.http.routers.app.rule=Host(`app.example.com`)"