Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xcid/traefik-plugin-rewrite-headers
https://github.com/xcid/traefik-plugin-rewrite-headers
traefik-plugin
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/xcid/traefik-plugin-rewrite-headers
- Owner: XciD
- License: apache-2.0
- Created: 2021-08-24T07:22:11.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2024-10-19T06:32:08.000Z (3 months ago)
- Last Synced: 2024-11-02T06:21:28.147Z (3 months ago)
- Topics: traefik-plugin
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 17
- Watchers: 2
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Rewrite Header
Rewrite header is a middleware plugin for [Traefik](https://traefik.io) which replace a header in the response
## Configuration
### Static
```yaml
pilot:
token: "xxxx"experimental:
plugins:
rewriteHeaders:
modulename: "github.com/XciD/traefik-plugin-rewrite-headers"
version: "v0.0.4"
```### Dynamic
To configure the Rewrite Head plugin you should create a [middleware](https://docs.traefik.io/middlewares/overview/) in your dynamic configuration as explained [here](https://docs.traefik.io/middlewares/overview/).
The following example creates and uses the rewriteHeaders middleware plugin to modify the Location header```yaml
http:
routes:
my-router:
rule: "Host(`localhost`)"
service: "my-service"
middlewares :
- "rewriteHeaders"
services:
my-service:
loadBalancer:
servers:
- url: "http://127.0.0.1"
middlewares:
rewriteHeaders:
plugin:
rewriteHeaders:
rewrites:
- header: "Location"
regex: "^http://(.+)$"
replacement: "https://$1"
```