2019-02-26 13:50:07 +00:00
|
|
|
# TODO -- ReplacePath
|
|
|
|
|
|
|
|
Updating the Path Before Forwarding the Request
|
|
|
|
{: .subtitle }
|
|
|
|
|
|
|
|
`TODO: add schema`
|
|
|
|
|
|
|
|
Replace the path of the request url.
|
|
|
|
|
|
|
|
## Configuration Examples
|
|
|
|
|
2019-04-03 12:32:04 +00:00
|
|
|
```yaml tab="Docker"
|
|
|
|
# Replace the path by /foo
|
|
|
|
labels:
|
|
|
|
- "traefik.http.middlewares.test-replacepath.replacepath.path=/foo"
|
|
|
|
```
|
|
|
|
|
|
|
|
```yaml tab="Kubernetes"
|
|
|
|
# Replace the path by /foo
|
|
|
|
apiVersion: traefik.containo.us/v1alpha1
|
|
|
|
kind: Middleware
|
|
|
|
metadata:
|
|
|
|
name: test-replacepath
|
|
|
|
spec:
|
|
|
|
replacePath:
|
|
|
|
path: /foo
|
|
|
|
```
|
|
|
|
|
|
|
|
```toml tab="File"
|
|
|
|
# Replace the path by /foo
|
|
|
|
[http.middlewares]
|
|
|
|
[http.middlewares.test-replacepath.ReplacePath]
|
|
|
|
path = "/foo"
|
|
|
|
```
|
|
|
|
|
2019-02-26 13:50:07 +00:00
|
|
|
## Configuration Options
|
|
|
|
|
|
|
|
### General
|
|
|
|
|
|
|
|
The ReplacePath middleware will:
|
|
|
|
|
|
|
|
* replace the actual path by the specified one.
|
|
|
|
* store the original path in a `X-Replaced-Path` header.
|
|
|
|
|
2019-04-03 12:32:04 +00:00
|
|
|
### `path`
|
2019-02-26 13:50:07 +00:00
|
|
|
|
|
|
|
The `path` option defines the path to use as replacement in the request url.
|