Skip to content

[Bug]: client-max-body-size is ignored when using a route with splits on a VirtualServer #7937

Open
@YoavSitbon

Description

@YoavSitbon

Version

3.7.1

What Kubernetes platforms are you running on?

Openshift

Steps to reproduce

  1. create a virtualserver with a route with splits and upstreams with client-max-body-size. example:
apiVersion: k8s.nginx.org/v1
kind: VirtualServer
metadata:
  name: splits-vs
  namespace: vs-namspace
spec:
  host: splits.com
  upstreams:
  - name: upstream1
    service: svc1
    port: 80
    client-max-body-size: 15M
  - name: upstream2
    service: svc2
    port: 80
    client-max-body-size: 15M
  routes:
  - path: /
    splits:
      - weight: 50
        action:
          pass: upstream1
      - weight: 50
        action:
          pass: upstream2
  1. make a request to the host with a body size that should be allowed by the configuration. for example try a post request with a 10MB file in the body.
  2. should get a "413 Request Entity Too Large response" that indicates the client-max-body-size option was ignored.

Temporary Solution
I was able to overcome this issue by adding:

  server-snippets: |
    client_max_body_size 15M;

however we try to avoid using snippets as much as possible and there is no apparent reason on why it's not working without the snippet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backlogPull requests/issues that are backlog itemsbugAn issue reporting a potential bugready for refinementAn issue that was triaged and it is ready to be refined

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions