1

I am working with a 3D simulator web site and it has options to import model as zip files. I was able to import upto 70MB of zip files into my development and production environments. But recently it was migrated to kubernetes using nginx reverse proxy. Afterwards I am unable to load zip files larger than 1MB .I tried to configure nginx config file, setting up limit for multer but doesn't make any difference. I am using ajax call but the error case with error "Request entity too large" is getting executed.

Thanks in advance

1 Answers1

1

Nginx supports changing the max body size. If you're using a Kubernetes Ingress object you can do so in the following way:

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: myapp
  namespace: default
  annotations:
    kubernetes.io/ingress.class: "nginx"
    cert-manager.io/cluster-issuer: "letsencrypt-prod"
    nginx.ingress.kubernetes.io/proxy-body-size: 512m # Max body size for ingress.
spec:
  tls:
    - hosts:
        - "somehost.com"
      secretName: somehost-tls
  rules:
    - host: somehost.com
      http:
        paths:
          - path: /
            backend:
              serviceName: myapp
              servicePort: 80

I don't know how you're running Nginx. It may be that you're running it in a non-ingress way. For that you can edit the Nginx config: Default nginx client_max_body_size

Justin Tamblyn
  • 719
  • 8
  • 21