envoyproxy/gateway

Add support for max request header size

Open

#5,368 opened on 2025年2月27日

GitHub で見る
 (9 comments) (3 reactions) (1 assignee)Go (802 forks)auto 404
help wanted

Repository metrics

Stars
 (2,871 stars)
PR merge metrics
 (PR metrics pending)

説明

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.

コントリビューターガイド