Skip to content

Traefik plugin used to translate a http status code to another one

Notifications You must be signed in to change notification settings

pierre-verhaeghe/traefik-replace-response-code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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

# 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.

# 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

About

Traefik plugin used to translate a http status code to another one

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages