Skip to content

Add support for max request header size #5368

@zeisich

Description

@zeisich

Description:
I've been trying different things to allow requests with a particularly large Authorization header to be accepted. This is how I configured EnvoyProxy with a JSONPatch on the bootstrap configuration.

apiVersion: gateway.envoyproxy.io/v1alpha1
kind: EnvoyProxy
metadata:
  name: custom-proxy-config
  namespace: envoy
spec:
  mergeGateways: true
  bootstrap:
    type: JSONPatch
    jsonPatches:
      - op: "add"
        jsonPath: "static_resources.listeners[0].filter_chains[0].filters[0].typed_config"
        path: "max_request_headers_kb"
        value: 96

I can see it reflecting on my pods:

listeners:
      - address:
          socketAddress:
            address: 0.0.0.0
            portValue: 19001
        filterChains:
        - filters:
          - name: envoy.filters.network.http_connection_manager
            typedConfig:
              '@type': type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
              httpFilters:
              - name: envoy.filters.http.health_check
                typedConfig:
                  '@type': type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck
                  headers:
                  - name: :path
                    stringMatch:
                      exact: /ready
                  passThroughMode: false
              - name: envoy.filters.http.router
                typedConfig:
                  '@type': type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
              maxRequestHeadersKb: 96
              routeConfig:
                name: local_route
                virtualHosts:
                - domains:
                  - '*'
                  name: prometheus_stats
                  routes:
                  - match:
                      prefix: /stats/prometheus
                    route:
                      cluster: prometheus_stats
              statPrefix: eg-ready-http
        name: envoy-gateway-proxy-ready-0.0.0.0-19001

But I still get status 431 Request Header Fields Too Large. Any help appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions