-
Notifications
You must be signed in to change notification settings - Fork 3
/
rules-header-transform.yaml
95 lines (93 loc) · 2.5 KB
/
rules-header-transform.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Template for configuration
http:
routers:
my-router:
middlewares:
- header-transform
entrypoints:
- http
service: service-whoami
rule: Path(`/whoami`)
services:
service-whoami:
loadBalancer:
servers:
- url: http://localhost:5000
passHostHeader: false
middlewares:
header-transform:
plugin:
dev:
Rules:
- Rule:
Name: 'Header transformation'
Header: 'X-Traefik-*'
Value: 'X-custom'
Type: 'Rename'
- Rule:
Name: 'Header addition'
Header: 'X-Custom'
Value: 'True'
Type: 'Set'
- Rule:
Name: 'Header addition'
Header: 'X-Custom-2'
Value: 'True'
Type: 'Set'
- Rule:
Name: 'Header deletion'
Header: 'X-forward'
Type: 'Del'
- Rule:
Name: 'Header join'
Header: 'X-Custom-2'
Sep: ','
Values:
- 'False'
- 'Idk'
Type: 'Set'
- Rule:
Name: 'Header join'
Header: 'Cache-Control'
Sep: ','
Values:
- 'Foo'
- 'Bar'
Type: 'Set'
# Advanced use cases for fix of #14
- Rule:
Name: 'Header transformation to another header value'
Header: 'X-Traefik-*'
Value: '^X-custom'
HeaderPrefix: "^"
Type: 'Rename'
- Rule:
Name: 'Header addition'
Header: 'X-Custom'
Value: '^X-Source'
HeaderPrefix: "^"
Type: 'Set'
- Rule:
Name: 'Header addition'
Header: 'X-Custom-2'
Value: '^X-Source'
HeaderPrefix: "^"
Type: 'Set'
- Rule:
Name: 'Header join'
Header: 'X-Custom-2'
Sep: ','
HeaderPrefix: "^"
Values:
- '^X-Source-1'
- 'Foo'
Type: 'Set'
- Rule:
Name: 'Header join'
Header: 'X-Forwarded-For'
Sep: ','
HeaderPrefix: "^"
Values:
- '^CF-Connecting-IP'
- '192.168.0.1'
Type: 'Set'