1
0
Fork 0

Update the middleware documentation

This commit is contained in:
Jean-Baptiste Doumenjou 2019-04-08 17:14:08 +02:00 committed by Traefiker Bot
parent 6ab991ebf4
commit 2e20394af4
24 changed files with 488 additions and 70 deletions

View file

@ -1,4 +1,4 @@
# TODO - RedirectRegex
# RedirectRegex
Redirecting the Client to a Different Location
{: .subtitle }
@ -28,6 +28,13 @@ spec:
replacement: http://mydomain/$1
```
```yaml tab="Rancher"
# Redirect with domain replacement
labels:
- "traefik.http.middlewares.test-redirectregex.redirectregex.regex=^http://localhost/(.*)"
- "traefik.http.middlewares.test-redirectregex.redirectregex.replacement=http://mydomain/$1"
```
```toml tab="File"
# Redirect with domain replacement
[http.middlewares]
@ -44,7 +51,7 @@ Set the `permanent` option to `true` to apply a permanent redirection.
### `regex`
The `Regex` option is the regular expression to match and capture elements form the request URL.
The `Regex` option is the regular expression to match and capture elements from the request URL.
!!! warning