generated from kubernetes/kubernetes-template-project
-
Notifications
You must be signed in to change notification settings - Fork 473
/
httproute-rewrite-path.yaml
98 lines (98 loc) · 2.21 KB
/
httproute-rewrite-path.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
96
97
98
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: rewrite-path
namespace: gateway-conformance-infra
spec:
parentRefs:
- name: same-namespace
rules:
- matches:
- path:
type: PathPrefix
value: /prefix/one
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /one
backendRefs:
- name: infra-backend-v1
port: 8080
- matches:
- path:
type: PathPrefix
value: /strip-prefix
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /
backendRefs:
- name: infra-backend-v1
port: 8080
- matches:
- path:
type: PathPrefix
value: /full/one
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /one
backendRefs:
- name: infra-backend-v1
port: 8080
- matches:
- path:
type: PathPrefix
value: /full/rewrite-path-and-modify-headers
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplaceFullPath
replaceFullPath: /test
- type: RequestHeaderModifier
requestHeaderModifier:
set:
- name: X-Header-Set
value: set-overwrites-values
add:
- name: X-Header-Add
value: header-val-1
- name: X-Header-Add-Append
value: header-val-2
remove:
- X-Header-Remove
backendRefs:
- name: infra-backend-v1
port: 8080
- matches:
- path:
type: PathPrefix
value: /prefix/rewrite-path-and-modify-headers
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /prefix
- type: RequestHeaderModifier
requestHeaderModifier:
set:
- name: X-Header-Set
value: set-overwrites-values
add:
- name: X-Header-Add
value: header-val-1
- name: X-Header-Add-Append
value: header-val-2
remove:
- X-Header-Remove
backendRefs:
- name: infra-backend-v1
port: 8080