Cookie Path Prefixer is a middleware plugin for Traefik which adds a prefix to the path of a cookie in the response. If no path is defined in the cookie, a new path constructed from the prefix will be set.
experimental:plugins:cookiePathPrefix:modulename: "github.com/SchmitzDan/traefik-plugin-cookie-path-prefix"version: "v0.0.3" #replace with newest version
To configure the plugin you should create a middleware in your dynamic configuration as explained here. The following example creates and uses the cookie path prefix middleware plugin to add the prefix "/foo" to the cookie paths:
http:routes:my-router:rule: "Host(`localhost`)"service: "my-service"middlewares :- "cookiePathPrefix"services:my-service:loadBalancer:servers:- url: "http://127.0.0.1"middlewares:cookiePathPrefix:plugin:cookiePathPrefix:prefix: "foo"
Configuration can also be set via toml or docker labels.