Increase File Size - APISIX Ingress
Increasing the Max File upload size limit on the CX solution, 2 tiered changes will be required
at the apisix ingress layer
per apisix route
APISIX Ingress
Edit the helm-values/apisix-custom-values.yaml and locate the YAML heirarchy dataPlane.ingress.annotations and add these annotations
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 apisix by
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 apisix ingress by describing the ingress annotations and look at the annotations object.
k -n ef-external get ingress apisix-data-plane -o yaml
APISIX Routes Customization
Please add in the relevant apisixRoute in values.yaml file before installing the solution . Example given below allows the max size of 5MB.
customPlugins:
- name: client-control
enable: false
config:
max_body_size: 5242880
However, if the solution is already deployed, run the same helm upgrade
command as used while installing the solution.
Examples
update the ef-cx-custom-values.yaml
unified-admin:
apisixRoutes:
# Route 1: Main /unified-admin/* path
- nameSuffix: "main"
enabled: true
paths: ["/unified-admin/*"]
backendServicePort: 3000
plugins:
enableAuth: false
enableRewrite: true
rewriteStripPrefix: false # Custom rewrite for slash
rewriteRegexUriFrom: "^/unified-admin/?(.*)"
rewriteRegexUriTo: "/$1"
enableCors: true
customPlugins:
- name: client-control
enable: false
config:
max_body_size: 5242880
# Route 2: Default /* route
- nameSuffix: "default"
enabled: true
priority: -10
paths: ["/*"]
backendServicePort: 3000
plugins:
enableAuth: false # No auth on default
enableRewrite: false # No rewrite needed
customPlugins:
- name: client-control
enable: false
config:
max_body_size: 5242880
Customer-Widget
customer-widget:
apisixRoutes:
# Route 1: Main path
- nameSuffix: "main"
enabled: true
paths: ["/customer-widget/*"]
backendServicePort: 80
plugins:
enableAuth: false
enableRewrite: true # Uses default stripPrefix
customPlugins:
- name: client-control
enable: false
config:
max_body_size: 5242880
# Route 2: Assets path
- nameSuffix: "assets"
enabled: true
paths: ["/widget-assets/*"]
backendServicePort: 80
plugins:
enableAuth: false
enableRewrite: false # No rewrite needed
enableCors: true
customPlugins:
- name: client-control
enable: false
config:
max_body_size: 5242880
For Agent-Desk, edit the cx-agent-desk-custom-values.yaml file and change as per below
unified-agent:
apisixRoutes:
# Route 1: Main application path
- nameSuffix: "main"
enabled: true
priority: 0 # Default priority
paths: ["/unified-agent", "/unified-agent/*"] # Matches /unified-agent/ and everything after
backendServicePort: 80
plugins:
enableAuth: false # Assumed: Main application endpoints require auth
enableRewrite: true # Corresponds to rewrite-target removing /unified-agent
# rewriteStripPrefix: true is implied by enableRewrite: true unless overridden
enableCors: true # From ingress annotations
customPlugins:
- name: client-control
enable: false
config:
max_body_size: 5242880
# Route 2: Assets path
- nameSuffix: "assets"
enabled: true
priority: 0 # Same priority should be fine as paths are distinct prefixes
paths: ["/assets/*"] # Matches /assets/* directly
backendServicePort: 80
plugins:
enableAuth: false # Assumed: Assets typically don't require auth
enableRewrite: false # No rewrite annotation was present for assets ingress
enableCors: true # From ingress annotations
customPlugins:
- name: client-control
enable: false
config:
max_body_size: 5242880