I want to remove some headers when the traffic comes from 80 or a specified port alone but even after the envoy filter still the header exists in the application. I even have the sidecars injected in the pods could someone tell whats wrong in this ?
kind: EnvoyFilter
metadata:
name: filter-headers
spec:
configPatches:
- applyTo: HTTP_FILTER
match:
context: SIDECAR_INBOUND
listener:
portNumber: 80
filterChain:
filter:
name: "envoy.http_connection_manager"
subFilter:
name: "envoy.router"
patch:
operation: INSERT_BEFORE
value: # lua filter specification
name: envoy.lua
typed_config:
"@type": "type.googleapis.com/envoy.config.filter.http.lua.v2.Lua"
inlineCode: |
function envoy_on_request(request_handle)
request_handle:headers():remove("X-Forwarded-Prefix")
end