traefik/docs/content/middlewares/addprefix.md
Julien Salleyron d1d2611665 Handle TCP in the marathon provider
Co-authored-by: Mathieu Lonjaret <mathieu.lonjaret@gmail.com>
2019-04-15 18:22:07 +02:00

1,007 B

Add Prefix

Prefixing the Path {: .subtitle }

AddPrefix

The AddPrefix middleware updates the URL Path of the request before forwarding it.

Configuration Examples

# Prefixing with /foo
labels:
- "traefik.http.middlewares.add-foo.addprefix.prefix=/foo"
# Prefixing with /foo
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
  name: add-foo
spec:
  addPrefix:
    prefix: /foo
"labels": {
  "traefik.http.middlewares.add-foo.addprefix.prefix": "/foo"
}
# Prefixing with /foo
labels:
- "traefik.http.middlewares.add-foo.addprefix.prefix=/foo"
# Prefixing with /foo
[http.middlewares]
  [http.middlewares.add-foo.AddPrefix]
     prefix = "/foo"

Configuration Options

prefix

prefix is the string to add before the current path in the requested URL. It should include the leading slash (/).