Hi,
I would like to configure two envoy.filters.network.http_connection_manager, one for plain http1, one for http1 websocket connections.
The underlying reason is that I use the envoy.filters.http.buffer http filter in case of plain http1 requests, which doesn't work in case of websockets (due to the http upgrade as the official docs explain).
So, I came up with
-
name: envoy.filters.network.http_connection_manager
typed_config:
stat_prefix: ingress_http1
codec_type: HTTP1
_remote_address
xff_num_trusted_hops: 0
common_http_protocol_options:
idle_timeout: 900s
route_config:
name: route_http1
virtual_hosts:
...
http_filters:
-
name: envoy.filters.http.buffer # Note that buffering is generally not compatible with upgrades, so if the Buffer filter is configured in the default HTTP filter chain it should probably be excluded for upgrades by using upgrade filters and not including the buffer filter in that list.
typed_config:
max_request_bytes: 5242880
-
name: envoy.filters.http.router
typed_config:
...
-
name: envoy.filters.network.http_connection_manager
typed_config:
stat_prefix: ingress_http1_websocket
codec_type: HTTP1
xff_num_trusted_hops: 0
common_http_protocol_options:
idle_timeout: 900s
upgrade_configs:
-
upgrade_type: websocket
route_config:
name: route_http1_websocket
virtual_hosts:
...
http_filters:
-
name: envoy.filters.http.router
typed_config:
...
which is wrong, as it complains about:
[2021-04-30 18:04:31.097][23561][critical][main] [external/envoy/source/server/config_validation/server.cc:60] error initializing configuration '/etc/envoy.d/envoy.mesh.yaml': Error: terminal filter named envoy.filters.network.http_connection_manager of type envoy.filters.network.http_connection_manager must be the last filter in a network filter chain.
Can a more experienced envoy user (than me) enlighten please what I am doing wrong?
I am not able to understand the underlying issue and error message.
with kind regards,