Skip to content

r3nic1e/traefik-plugin-add-response-header

Repository files navigation

traefik-plugin-add-response-header

Traefik proxy plugin to copy request header to response. I use this plugin to copy assigned trace ID to response headers.

This plugin copies full response body to temporary buffer. Serious performance issues may occur

Configuration

Add plugin:

experimental:
  plugins:
    add-response-header:
      moduleName: github.com/r3nic1e/traefik-plugin-add-response-header
      version: v0.4.0

Configure middleware:

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: add-response-header
spec:
  plugin:
    add-response-header:
      from: "X-B3-TraceId"
      to: "X-B3-TraceId"

You can also use regexp:

apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: add-response-header
spec:
  plugin:
    add-response-header:
      from: "X-B3-TraceId"
      to: "X-B3-TraceId"
      overwrite: true
      regexp: "^(.*)/(.*)$"
      replacement: "$1:$2"

About

Traefik proxy plugin to copy request header to response

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages