Middleware Manager: Centralized Management for Traefik & Pangolin Middleware

Middleware Manager: Centralized Management for Traefik & Pangolin Middleware

Summary

Middleware Manager is a powerful microservice designed to simplify the management of Traefik and Pangolin resources. It provides a user-friendly web interface to define, attach, and configure custom Traefik middlewares, services, and plugins. This tool enhances control over your network's routing, security, and load balancing configurations.

Repository Info

Updated on January 1, 2026
View on GitHub

Tags

Click on any tag to explore related repositories

Introduction

The Middleware Manager is a specialized microservice that empowers you to attach custom Traefik middlewares to your HTTP/TCP/UDP resources, manage router configurations, define custom Traefik services, and install Traefik plugins, all through a user-friendly web interface. It provides crucial functionality for implementing authentication, security headers, rate limiting, custom routing logic, and other middleware-based protections with ease. This tool monitors resources from your chosen data source, either a Pangolin API or a direct Traefik API connection, and generates the necessary Traefik dynamic configuration files.

Installation

To deploy Middleware Manager, you'll need Docker and Docker Compose, along with an existing Traefik v2.x or v3.x instance. Middleware Manager can connect directly to your Traefik API or a Pangolin API.

First, ensure you have a running Traefik instance configured to use file providers for dynamic configuration and with its API exposed. For plugin management, Traefik's static configuration file (e.g., traefik.yml) must be accessible via a volume mount.

Create the necessary host directories for Middleware Manager data and Traefik rules:

mkdir -p ./middleware_manager_data ./traefik_rules ./traefik_static_config

Then, you can integrate Middleware Manager using Docker Compose. Here's a simplified example for a standalone Traefik setup:

services:
  middleware-manager:
    image: hhftechnology/middleware-manager:traefik-int
    container_name: middleware-manager
    restart: unless-stopped
    volumes:
      - ./middleware_manager_data:/data # For the SQLite database
      - ./traefik_rules:/conf           # MUST MATCH Traefik's rule directory
      - ./traefik_static_config:/etc/traefik # Mount Traefik's static config dir for plugin management
    environment:
      - TRAEFIK_API_URL=http://your-traefik-host:8080 # Update with your Traefik API URL
      - TRAEFIK_CONF_DIR=/conf
      - DB_PATH=/data/middleware.db
      - PORT=3456
      - ACTIVE_DATA_SOURCE=traefik # Set to 'pangolin' or 'traefik'
      - TRAEFIK_STATIC_CONFIG_PATH=/etc/traefik/traefik.yml # Path inside MM container
    ports:
      - "3456:3456"
    networks:
      - your_traefik_network # Ensure this matches your Traefik's network

After setting up your docker-compose.yml and creating the directories, start the services:

docker-compose up -d

Access the Middleware Manager UI at http://your-server-ip:3456. For a full stack example with Pangolin, refer to the official GitHub repository.

Examples

Middleware Manager provides a comprehensive web UI to manage various aspects of your Traefik configuration:

  • Managing Resources: Attach custom Traefik middlewares to your HTTP/TCP/UDP resources. Configure advanced router settings, including entrypoints, TLS Subject Alternative Names (SANs), TCP SNI routing rules, custom request headers, and router priority.
  • Managing Services: Create, update, and delete custom Traefik services such as LoadBalancer, Weighted, Mirroring, and Failover. Define servers with specific protocols (HTTP, TCP, UDP) and assign these custom services to your resources.
  • Managing Plugins (Plugin Hub): Discover, install, and manage Traefik plugins directly from the UI. The TRAEFIK_STATIC_CONFIG_PATH environment variable is crucial here, as it tells Middleware Manager where to find Traefik's main static configuration file for plugin declarations. Remember that Traefik must be restarted after installing or removing plugins for changes to take effect.

Why Use It

Middleware Manager offers a centralized and intuitive web interface for managing complex Traefik and Pangolin configurations. It simplifies the deployment and configuration of middlewares, services, and plugins, reducing manual errors and saving time. By providing granular control over routing, security headers, rate limiting, and load balancing, it empowers users to enhance their network's resilience and performance. Its dual data source support makes it versatile for both standalone Traefik setups and integrated Pangolin environments.

Links