mirror of https://github.com/hashicorp/consul
docs: fix incorrect proxy-defaults config in Lua Envoy extension (#18418)
fix incorrect proxy-defaults configpull/18437/head
parent
bb1a288b74
commit
10f69d86d0
|
@ -42,15 +42,17 @@ The following example configures the Lua Envoy extension on every service by usi
|
|||
<CodeBlockConfig filename="lua-envoy-extension-proxy-defaults.hcl">
|
||||
|
||||
```hcl
|
||||
Kind = "proxy-defaults"
|
||||
Name = "global"
|
||||
Protocol = "http"
|
||||
Kind = "proxy-defaults"
|
||||
Name = "global"
|
||||
Config {
|
||||
protocol = "http"
|
||||
}
|
||||
EnvoyExtensions {
|
||||
Name = "builtin/lua"
|
||||
Arguments = {
|
||||
ProxyType = "connect-proxy"
|
||||
Listener = "inbound"
|
||||
Script = <<-EOS
|
||||
Script = <<-EOF
|
||||
function envoy_on_request(request_handle)
|
||||
meta = request_handle:streamInfo():dynamicMetadata()
|
||||
m = meta:get("consul")
|
||||
|
@ -59,7 +61,7 @@ function envoy_on_request(request_handle)
|
|||
request_handle:headers():add("x-consul-datacenter", m["datacenter"])
|
||||
request_handle:headers():add("x-consul-trust-domain", m["trust-domain"])
|
||||
end
|
||||
EOS
|
||||
EOF
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue