Skip to content

This is Traefik middleware plugin to extract host from the HTTP request and put it to a new header.

Notifications You must be signed in to change notification settings

Uscreen-video/traefik-plugin-rewritehost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rewrite Host

Rewrite host is a middleware plugin for Traefik which extracts host and put it to specified header.

Configuration

Static

[pilot]
  token = "xxxx"

[experimental.plugins.rewritehost]
  modulename = "github.com/Uscreen-video/traefik-plugin-rewritehost"
  version = "v0.0.1"

Dynamic

To configure the Rewrite Host plugin you should create a middleware in your dynamic configuration as explained here. The following example creates and uses the rewritehost middleware plugin to create a new header with extracted data from host.

[http]
  [http.routers]
    [http.routers.my-router]
      rule = "Host(`localhost`)"
      service = "my-service"
      middlewares = ["rewritehost"]

  [http.services]
    [http.services.my-service.loadBalancer]
      [[http.services.my-service.loadBalancer.servers]]
        url = "http://127.0.0.1"

  [http.middlewares]
    [http.middlewares.rewritehost.plugin.dev]
      create    = "X-Origin-Domain"    //required

About

This is Traefik middleware plugin to extract host from the HTTP request and put it to a new header.

Topics

Resources

Stars

Watchers

Forks

Languages