Skip to content

Document non-dev configuration with localPlugins and middleware? #3

@Cobertos

Description

@Cobertos

It might help to add a non-dev configuration to the docs/README?

I know it's still pretty experimental, but Traefik v2.5 supports local plugins now (it's really hard to find documentation on it though):

You can then mount this into the Traefik container with docker-compose like so:

(static configuration)

command:
      # This will be search for in /plugins-local/src/github.com/adyanth/header-transform
      - "--experimental.localPlugins.header-transform.moduleName=github.com/adyanth/header-transform"
      - "--providers.file.filename=/htransform-rules.yaml" 

+

http:
  middlewares:
    header-transform:
      plugin:
        # Plugin name here is the part after `experimental.localPlugins`
        header-transform:
          Rules:
            - Rule:
              Name: 'X-Client-Port Set'
              Header: 'X-Client-Port'
              Value: '^X-Forwarded-Port'
              HeaderPrefix: "^"
              Type: 'Set'
            - Rule:
              Name: 'X-SSL-Cert Set'
              Header: 'X-SSL-Cert'
              Value: '^X-Forwarded-Tls-Client-Cert'
              HeaderPrefix: "^"
              Type: 'Set'

and

volumes:
      - "./traefik/htransform-rules.yaml:/htransform-rules.yaml"
      - "./traefik/header-transform:/plugins-local/src/github.com/adyanth/header-transform"

Then you can simply add it to the middleware list for any http router as header-transform@file

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions