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
|
|
|
|
|
|
|
|
??? example "File -- Replace the path by /foo"
|
|
|
|
|
|
|
|
```toml
|
2019-03-14 08:30:04 +00:00
|
|
|
[http.middlewares]
|
|
|
|
[http.middlewares.test-replacepath.ReplacePath]
|
2019-02-26 13:50:07 +00:00
|
|
|
path = "/foo"
|
|
|
|
```
|
|
|
|
|
|
|
|
??? example "Docker --Replace the path by /foo"
|
|
|
|
|
|
|
|
```yaml
|
|
|
|
a-container:
|
|
|
|
image: a-container-image
|
|
|
|
labels:
|
2019-03-14 08:30:04 +00:00
|
|
|
- "traefik.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.
|
|
|
|
|
|
|
|
### path
|
|
|
|
|
|
|
|
The `path` option defines the path to use as replacement in the request url.
|