traefik_custom_headers_plugin

package module
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

Rename Header

Traefik custom headers plugin is a middleware plugin for Traefik which renames headers in the response, while keeping their values.

Configuration

Static
pilot:
  token: "xxxx"

experimental:
  plugins:
    renameHeaders:
      modulename: "gitlab.com/traefik-custom-headers-plugin/traefik-custom-headers-plugin"
      version: "v0.0.1"
Dynamic

To configure the Rename Headers plugin you should create a middleware in your dynamic configuration as explained here. The following example creates and uses the renameHeaders middleware plugin to rename the "custom_id" header

http:
  routes:
    my-router:
      rule: "Host(`localhost`)"
      service: "my-service"
      middlewares : 
        - "renameHeaders"
  services:
    my-service:
      loadBalancer:
        servers:
          - url: "http://127.0.0.1"
  middlewares:
    renameHeaders:
      plugin:
        renameData:
          - existingHeaderName: "Customheader"
          newHeaderName: "customheader"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(_ context.Context, next http.Handler, config *Config, name string) (http.Handler, error)

New creates a new Custom Header plugin.

Types

type Config

type Config struct {
	RenameData []renameData `json:"renameData"`
}

Config holds the plugin configuration.

func CreateConfig

func CreateConfig() *Config

CreateConfig creates and initializes the plugin configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL