Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/melchor629/traefik-error-page
- Owner: melchor629
- License: apache-2.0
- Created: 2023-12-01T15:02:01.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2023-12-02T18:52:54.000Z (11 months ago)
- Last Synced: 2024-01-02T02:44:16.447Z (10 months ago)
- Topics: traefik-plugin
- Language: Go
- Homepage: https://plugins.traefik.io/plugins/6569fc07ce37949adf28307f/error-pages
- Size: 26.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
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
```