Add Prefix

前缀路径

AddPrefix

AddPrefix中间件在转发请求之前先更新请求的URL路径.

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"
# Prefixing with /foo
http:
  middlewares:
    add-foo:
      addPrefix:
        prefix: "/foo"

Configuration Options

prefix

prefix是在请求的URL中当前路径之前添加的字符串. 它应包含斜杠( / ).