Increase File Size - API Gateway Ingress
Increasing the Max File upload size limit on the CX solution, 2-tiered changes will be required
At the API gateway ingress layer
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
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
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.
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.
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
- 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
- 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
- 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
- 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" } }