Proxy Cookie Plugin
Proxy Cookie Plugin is a middleware plugin for Traefik which adds the functionylity of the proxy_cookie directives known from NGINX to Traefik.
Configuration
Static
experimental:
plugins:
proxyCookie:
modulename: "github.com/SchmitzDan/traefik-plugin-proxy-cookie"
version: "v0.0.x"
Dynamic
To configure the plugin you should create a middleware in your dynamic configuration as explained here.
The following example creates and uses the plugin to add the prefix "/foo" to the cookie paths and change the cookie domain from "subdomain.foo." to "foo.":
http:
routes:
my-router:
rule: "Host(`localhost`)"
service: "my-service"
middlewares :
- "proxyCookie"
services:
my-service:
loadBalancer:
servers:
- url: "http://127.0.0.1"
middlewares:
proxyCookie:
plugin:
proxyCookie:
domain:
rewrites:
- regex: "^subdomain.foo.(.+)$"
replacement: "foo.$1"
path:
prefix: "foo"
Configuration can also be set via toml or docker labels.
You can also define a set of rewrites for the path. If both, a prefix and one or more rewrites is defined for the path, the path will be prefixed first and afterwords the rewrites are applied to the path.