Skip to content

SnippetsFilter is applied to Nginx config but not working #4636

Description

@rr-krupesh-savaliya

Describe the bug
I applied large_client_header_buffers via SnippetsFilter but it's not taking affect.

To Reproduce
Steps to reproduce the behavior:

  1. Deploy below SnippetsFilter and Update HTTPRoute
apiVersion: gateway.nginx.org/v1alpha1
kind: SnippetsFilter
metadata:
  name: nginx-custom-config-snippet
  namespace: nginx-gateway
spec:
  snippets:
    - context: http.server
      value: |
        large_client_header_buffers 4 16k;
        client_header_buffer_size 16k;
  1. Connect the gateway nginx pod and see the nginx config
  2. You will see include /etc/nginx/includes/SnippetsFilter_http_nginx-gateway_nginx-custom-config-snippet.conf at it contains the custom configs
  3. But when you pass header size more than 8k length then we are getting 400 instead of 200 status code.

Your environment

  • NGINX Gateway Fabric - 2.3.0
  • Version of Kubernetes - v1.33
  • Kubernetes platform - EKS
  • Details on how you expose the NGINX Gateway Fabric Pod - LoadBalancer and Port-forward (Also tried)
  • nginx -T - Valid

Testing

Worked if <8K -> 200 OK

curl -I -H "X-Custom-Header: $(python3 -c 'print("b"*8000)')" http://test.com

Not Working if >8K and <16K -> 400 Bad Request ( but it should be work till 16k header size )

curl -I -H "X-Custom-Header: $(python3 -c 'print("b"*15000)')" http://test.com

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions