<p>I want to use istio resource <code>EnvoyFilter</code> to change sidecar configurations to support custom <code>max_request_bytes</code>, because we encounter an error 413 when uploading too large file to server. But I am not familiar with envoy configurations.</p>

<p>Is there any one can give me a valid configuration of <code>EnvoyFilter</code>? Thanks！</p>

<p>On Istio 1.2 and 1.4 this works, but the API was changed and <code>filters</code> has been deprecated:</p>
<p>For the gateway (in the same namespace as the gateways):</p>
<pre><code>---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: request-size-limit
spec:
  filters:
    - listenerMatch:
        listenerType: GATEWAY
        listenerProtocol: HTTP
      filterName: envoy.buffer
      filterType: HTTP
      filterConfig:
        maxRequestBytes: 26214400 # 25MB

</code></pre>
<p>This <strong>should</strong> work up to 1.6 (tested on 1.4). It will not work in 1.7 without being modified:</p>
<pre><code>---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
  name: request-size-limit
  namespace: istio-system
spec:
  configPatches:
    - applyTo: HTTP_FILTER
      match:
        context: GATEWAY
        listener:
          filterChain:
            filter:
              name: &quot;envoy.http_connection_manager&quot;
      patch:
        operation: INSERT_BEFORE
        value:
          name: envoy.buffer
          config:
            maxRequestBytes: 26214400 # 25MB

</code></pre>
