https://github.com/colearendt/traefik-plugin-template-headers
A traefik plugin that allows modifying headers with go templates
https://github.com/colearendt/traefik-plugin-template-headers
traefik-plugin
Last synced: about 2 months ago
JSON representation
A traefik plugin that allows modifying headers with go templates
- Host: GitHub
- URL: https://github.com/colearendt/traefik-plugin-template-headers
- Owner: colearendt
- Created: 2022-05-18T14:04:27.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-05-27T00:56:01.000Z (about 3 years ago)
- Last Synced: 2025-02-14T12:33:21.254Z (4 months ago)
- Topics: traefik-plugin
- Language: Go
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Traefik Plugin: Auth Delay
A [traefik](https://traefik.io/) plugin to build additional request headers based on go templates.
This is meant to help replace some of the behavior that is common with request modification middlewares in
proxies like Apache/`httpd` or `nginx`.Data passed along to the template from the request object (`req`) for an example
URL (`https://localhost:80/some/path?query=true`):| key | value | Example |
|---------------------|-------------------------------------|-----------------------|
| Path | req.URL.EscapedPath() | /some/path |
| Scheme | req.URL.Scheme | https |
| Host | req.URL.Host | localhost:80 |
| Method | req.Method | GET |
| Proto | req.Proto | HTTP/1.1 |
| Query | req.URL.RawQuery | query=true |
| RequestURI | req.URL.RequestURI() | /some/path?query=true |
| HttpXForwardedProto | req.Header.Get("X-Forwarded-Proto") | https |
| HttpXForwardedHost | req.Header.Get("X-Forwarded-Host") | localhost:80 |
| HttpHost | req.Header.Get("Host") | localhost:80 |## Example Configuration
TODO
## What is a Traefik Plugin
TL;DR; A Traefik plugin is a custom middleware for Traefik.
[More on Traefik plugins is written here](https://doc.traefik.io/traefik/plugins/).
I also wrote [an init container](https://github.com/colearendt/traefik-plugin-init) that simplifies using "local"
plugins (i.e. plugins without Traefik Pilot) inside of Kubernetes.## TODO
- Decide about semantics for modifying, overwriting, appending, or removing headers
## Thanks
Inspired by and much boilerplate
from [traefik-plugin-rewrite-headers](https://github.com/XciD/traefik-plugin-rewrite-headers), which is a fantastically
useful Traefik Plugin.