/Upstream When

Upstream When

1
v0.1.4

Configuration

For each plugin, the Traefik static configuration must define the module name (as is usual for Go packages).

The following declaration (given here in YAML) defines an plugin:

# Static configuration
experimental:
plugins:
upstreamFirst:
moduleName: github.com/PandaWorker/traefik-upstream-when
version: v0.1.1

Here is an example of a file provider dynamic configuration (given here in YAML), where the interesting part is the http.middlewares section:

# Dynamic configuration
http:
routers:
my-router:
rule: host(`demo.localhost`)
service: service-foo
entryPoints:
- web
middlewares:
- my-plugin
services:
service-foo:
loadBalancer:
servers:
- url: http://127.0.0.1:5000
middlewares:
my-plugin:
upstreamFirst:
UpstreamUrl: http://127.0.0.1:5001
UpstreamStatus:
- 200

Dev Mode

The Traefik static configuration must define a plugin name, a GoPath, and the module name (as is usual for Go packages).

# Static configuration
experimental:
devPlugin:
goPath: /plugins/go
moduleName: github.com/PandaWorker/traefik-upstream-when