Cookie Path Rewrite is a middleware plugin for Traefik which rewrites the path of a cookie in the response. Inspired by SchmitzDan/traefik-plugin-cookie-path-prefix and XciD/traefik-plugin-rewrite-headers.
experimental:plugins:cookiePathRewrite:modulename: "github.com/vnghia/traefik-plugin-rewrite-cookie-path"version: "v0.0.1"
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 replace the cookies path whose key is someName
from /foo
to /bar
:
http:middlewares:cookiePathRewrite:plugin:cookiePathRewrite:rewrites:- name: someNameregex: "/foo"replacement: "/bar"
Configuration can also be set via toml or docker labels.