2020-04-03 19:41:10 +00:00
|
|
|
config_entries {
|
|
|
|
bootstrap = [
|
2020-05-06 21:09:24 +00:00
|
|
|
{
|
|
|
|
kind = "proxy-defaults"
|
|
|
|
name = "global"
|
|
|
|
config {
|
|
|
|
protocol = "http"
|
|
|
|
}
|
|
|
|
},
|
2020-04-03 19:41:10 +00:00
|
|
|
{
|
|
|
|
kind = "ingress-gateway"
|
|
|
|
name = "ingress-gateway"
|
|
|
|
|
|
|
|
listeners = [
|
|
|
|
{
|
2020-10-01 14:19:14 +00:00
|
|
|
port = 9999
|
2020-04-03 19:41:10 +00:00
|
|
|
protocol = "http"
|
|
|
|
services = [
|
|
|
|
{
|
|
|
|
name = "router"
|
2021-07-14 16:13:13 +00:00
|
|
|
request_headers {
|
|
|
|
add {
|
|
|
|
x-foo = "bar-req"
|
|
|
|
x-existing-1 = "appended-req"
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
x-existing-2 = "replaced-req"
|
2021-08-25 15:53:21 +00:00
|
|
|
x-client-ip = "%DOWNSTREAM_REMOTE_ADDRESS_WITHOUT_PORT%"
|
2021-07-14 16:13:13 +00:00
|
|
|
}
|
|
|
|
remove = ["x-bad-req"]
|
|
|
|
}
|
|
|
|
response_headers {
|
|
|
|
add {
|
|
|
|
x-foo = "bar-resp"
|
|
|
|
x-existing-1 = "appended-resp"
|
|
|
|
}
|
|
|
|
set {
|
|
|
|
x-existing-2 = "replaced-resp"
|
|
|
|
}
|
|
|
|
remove = ["x-bad-resp"]
|
|
|
|
}
|
2020-04-03 19:41:10 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
kind = "service-router"
|
|
|
|
// This is a "virtual" service name and will not have a backing
|
|
|
|
// service definition. It must match the name defined in the ingress
|
|
|
|
// configuration.
|
|
|
|
name = "router"
|
|
|
|
routes = [
|
|
|
|
{
|
|
|
|
match {
|
|
|
|
http {
|
|
|
|
path_prefix = "/s1/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
destination {
|
2020-10-01 14:19:14 +00:00
|
|
|
service = "s1"
|
2020-04-03 19:41:10 +00:00
|
|
|
prefix_rewrite = "/"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
match {
|
|
|
|
http {
|
|
|
|
path_prefix = "/s2/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
destination {
|
2020-10-01 14:19:14 +00:00
|
|
|
service = "s2"
|
2020-04-03 19:41:10 +00:00
|
|
|
prefix_rewrite = "/"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|