envoyproxy/gateway

Add support for max request header size

Open

#5368 aperta il 27 feb 2025

Vedi su GitHub
 (9 commenti) (3 reazioni) (1 assegnatario)Go (802 fork)auto 404
help wanted

Metriche repository

Star
 (2871 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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.

Guida contributor