Skip to content

path

path replaces the request path and optionally sets or deletes request headers.

yaml
server:
  http:
    middlewares:
      force_health_path:
        path:
          path: /health
          headers:
            X-Original-Path: ""
            X-Rewrite: turna
FieldDescription
pathNew value for r.URL.Path.
headersRequest headers to set. Empty values delete headers.

Use regex_path or url when the new path depends on the original request.