1
0
Fork 0

Adds middlewares examples for k8s.

This commit is contained in:
Ludovic Fernandez 2019-04-03 14:32:04 +02:00 committed by Traefiker Bot
parent 336135c392
commit 07d0eb9ae6
16 changed files with 552 additions and 261 deletions

View file

@ -20,19 +20,27 @@ labels:
- "traefik.http.middlewares.test-errorpage.errors.query=/{status}.html"
```
```yaml tab="Kubernetes"
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: test-errorpage
spec:
errors:
status:
- 500-599
service: serviceError
query: /{status}.html
```
```toml tab="File"
# Custom Error Page for 5XX
[http.routers]
[http.routers.router1]
Service = "my-service"
Rule = Host(`my-domain`)
[http.middlewares]
[http.middlewares.5XX-errors.Errors]
[http.middlewares.test-errorpage.Errors]
status = ["500-599"]
service = "error-handler-service"
query = "/error.html"
service = "serviceError"
query = "/{status}.html"
[http.services]
# ... definition of error-handler-service and my-service
```
@ -42,7 +50,7 @@ labels:
## Configuration Options
### status
### `status`
The `status` that will trigger the error page.
@ -52,10 +60,10 @@ The status code ranges are inclusive (`500-599` will trigger with every code bet
You can define either a status code like `500` or ranges with a syntax like `500-599`.
### service
### `service`
The service that will serve the new requested error page.
### query
### `query`
The URL for the error page (hosted by `service`). You can use `{status}` in the query, that will be replaced by the received status code.