https://github.com/pierre-verhaeghe/traefik-replace-response-code
Traefik plugin used to translate a http status code to another one
https://github.com/pierre-verhaeghe/traefik-replace-response-code
traefik-plugin
Last synced: 6 months ago
JSON representation
Traefik plugin used to translate a http status code to another one
- Host: GitHub
- URL: https://github.com/pierre-verhaeghe/traefik-replace-response-code
- Owner: pierre-verhaeghe
- Created: 2020-10-13T14:36:50.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-23T07:22:06.000Z (over 5 years ago)
- Last Synced: 2024-06-20T17:33:06.257Z (about 2 years ago)
- Topics: traefik-plugin
- Language: Go
- Homepage:
- Size: 12.7 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# traefik-replace-response-code
Traefik plugin used to replace a http response code. Can be useful for example to mask an internal error code with another status code.
### Warning : still under test. Not yet ready for production.
### Configuration
```toml
# Static configuration
[pilot]
token = "xxxx"
[experimental.plugins.replace]
modulename = "github.com/pierre-verhaeghe/traefik-replace-response-code"
version = "v0.2.0"
#
```
removeBody optional flag can be use to remove response body. By default removeBody is set to `false`.
```yaml
# Dynamic configuration
http:
routers:
my-router:
rule: host(`demo.localhost`)
service: service-foo
entryPoints:
- web
middlewares:
- my-plugin
services:
service-foo:
loadBalancer:
servers:
- url: http://127.0.0.1:5000
middlewares:
my-plugin:
plugin:
replace:
inputCode: 429
outputCode: 200
removeBody: true
```