-
Navigate to your
pangolin-rootdirectory. -
Edit your Pangolin
docker-compose.ymland add the rules volume mapping- ./config/traefik/rules:/rules:traefik: image: traefik:v3.3.3 container_name: traefik restart: unless-stopped network_mode: service:gerbil # Ports appear on the gerbil service depends_on: pangolin: condition: service_healthy command: - --configFile=/etc/traefik/traefik_config.yml volumes: - ./config/traefik:/etc/traefik:ro # Volume to store the Traefik configuration - ./config/letsencrypt:/letsencrypt # Volume to store the Let's Encrypt certificates - ./config/traefik/logs:/var/log/traefik # Volume to store Traefik logs - ./traefik/plugins-storage:/plugins-storage:rw - ./traefik/plugins-storage:/plugins-local:rw - ./config/traefik/rules:/rules - ./public_html:/var/www/html:ro -
Create a
rulesdirectory in your./config/traefikdirectory:mkdir -p ./config/traefik/rules -
Move the
dynamic_config.ymlinto the newrulesdirectorymv ./config/traefik/dynamic_config.yml ./config/traefik/rules/ -
Update
traefik_config.ymlproviders: http: endpoint: "http://pangolin:3001/api/v1/traefik-config" pollInterval: "5s" file: directory: /rules watch: true -
Restart the Pangolin stack:
docker compose down docker compose up -d --force-recreate -
Add a new
Resourcein Pangolin to expose the Traefik dashboard:
-
Locate the router (the site) that you need to add Custom Request Headers to and make note of the
nameandservice. For example:name:28-router&service:28-service@http -
Create a new file in the rules directory:
touch ./config/traefik/rules/custom-request-headers.yml -
Edit the newly created file and add the following ensuring to update it to :
http: middlewares: inject-auth: headers: customRequestHeaders: Authorization: "Bearer ABCDEFGH" # Changeme routers: 28-router-auth-bypass: # Update the name to the noted name and append -auth-bypass rule: "Host(`aiolists.example.tld`)" entryPoints: - websecure middlewares: - inject-auth service: "28-service@http" # Update the service to the exact service that you noted priority: 10000 # highest priority so this router always wins tls: certResolver: "letsencrypt" -
Save the file, and restart traefik
docker restart traefik -
Verify that there are no issues in the log
docker logs -f traefik -
Test whether or not you can bypass the Pangolin auth now using your custom header.
Last active
September 10, 2025 18:46
-
-
Save coltondick/6e3e158b3fa48016006813b86a5b583e to your computer and use it in GitHub Desktop.
Configure Custom Request Header in Pangolin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
