Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/melchor629/traefik-error-page

Traefik's error middleware, with a twist
https://github.com/melchor629/traefik-error-page

traefik-plugin

Last synced: about 5 hours ago
JSON representation

Traefik's error middleware, with a twist

Awesome Lists containing this project

README

        

# traefik error page

An adaptation of the [error](https://github.com/traefik/traefik/blob/master/pkg/middlewares/customerrors/custom_errors.go) middleware from traefik that works similar but allows to respond from the service only if the response from the real service has no body.

> **NOTE**: this code contains code from the aformentioned middleware.

## Configuration

Works similar as in the middleware, but there are extra configuration and the `service` works differently.

```yaml
http:
middlewares:
error-pages:
plugin:
traefik-error-page:
# range of status codes that the middleware will accept
status: ['400-499', '500-599']
# this should point to the root url of the service, the middleware cannot access to certain
# information from traefik like services, so this should point to the scheme://host[:port]
service: 'https://http.cat'
# the path to make the request to
query: '/{status}'
# only replace the response with the error from the other service if the real service
# answered without any content (true by default)
emptyOnly: true
# prints some logs
debug: false
```