Skip to main content
Skip table of contents

Increase File Size - API Gateway Ingress

Increasing the Max File upload size limit on the CX solution, 2-tiered changes will be required

  1. At the API gateway ingress layer

  2. per API gateway route

APISIX Ingress

Edit the helm-values/apisix-custom-values.yaml and locate the YAML hierarchy dataPlane.ingress.annotations and add these annotations

CODE
  annotations:
    # Set it the max + 1 to allow max file size
    nginx.ingress.kubernetes.io/proxy-body-size: "6m"
    nginx.ingress.kubernetes.io/proxy-read-timeout: "600s"
    nginx.ingress.kubernetes.io/proxy-send-timeout: "600s"
    nginx.ingress.kubernetes.io/proxy-connect-timeout: "60s"

update the deployment of API gateway by

CODE
helm upgrade --install --namespace ef-external --values helm-values/apisix-custom-values.yaml apisix expertflow/apisix --version 4.2.2

you can verify these implementations in API gateway ingress by describing the ingress annotations and look at the annotations object.

CODE
k -n ef-external get ingress apisix-data-plane -o yaml

APISIX Routes Customization

Please add in the relevant route in apisix values.yaml file before installing the solution . Example given below allows the max size of 5MB.

CODE
plugin:
  client-control:
  enable: true
  config: { max_body_size: 6291456 }

 However, if the solution is already deployed, run the same helm upgrade command as used while installing the solution.

Examples

update the apisix-custom-values.yaml, set the max_body_size under plugins to the required file-size, by default it's set to 6 MB, which will allow max-size of 5.9 MB,

Unified Admin

CODE
- id: ef-cx-unified-admin-route-frontend-spa-routes
       uris: ["/unified-admin*", "/unified-admin/*"]
       hosts: ["{{ .Values.global.ingressRouter }}"]
       priority: 0
       service_id: svc-unified-admin
       status: 1
       plugins:
         proxy-rewrite:
           enable: true
           regex_uri: ["^/unified-admin/?(.*)", "/$1"]
         cors:
           enable: true
           allow_origins: "*"
           allow_methods: "GET, POST, PUT, DELETE, PATCH, OPTIONS"
           allow_credentials: true
         client-control:
           enable: true
           config: { max_body_size: 6291456 }

Customer-Widget

CODE
- id: ef-cx-customer-widget-main
       uris: ["/customer-widget/*"]
       hosts: ["{{ .Values.global.ingressRouter }}"]
       priority: 0
       service_id: svc-customer-widget
       status: 1
       plugins:
         proxy-rewrite:
           enable: true
           regex_uri: ["^/customer-widget/?(.*)", "/$1"]
         client-control:
           enable: true
           config: { max_body_size: 6291456 }

 For Agent-Desk

CODE
 - id: cx-agent-desk-unified-agent-assets
       uris: ["/assets/*"]
       hosts: ["{{ .Values.global.ingressRouter }}"]
       priority: 0
       service_id: svc-unified-agent
       status: 1
       plugins:
         cors:
           enable: true
           allow_origins: "*"
           allow_methods: "GET, POST, PUT, DELETE, PATCH, OPTIONS"
           allow_credentials: true
         client-control:
           enable: true
           config: { max_body_size: 6291456 }

 For File-Engine

CODE
- id: ef-cx-file-engine-main
       uris: ["/file-engine/*"]
       hosts: ["{{ .Values.global.ingressRouter }}"]
       priority: 0
       service_id: svc-file-engine
       status: 1
       plugins:
         proxy-rewrite:
           enable: true
           regex_uri: ["^/file-engine/?(.*)", "/$1"]
         client-control:
           enable: true
           config: { max_body_size: 6291456 }
         response-rewrite:
           enable: true
           config:
             headers: { set: { X-XSS-Protection: "1; mode=block" } }
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.