Just like the optimization of nginx configuration parameters, we also need to optimize the default nginx-ingress-Controller and Kong-ingress-Controller of Ali Cloud.

Increase the size limit for response headers

Kong adds environment variables to the way Settings are configured

    - name: KONG_NGINX_PROXY_PROXY_BUFFER_SIZE
      value: 128k
    - name: KONG_NGINX_PROXY_PROXY_BUFFERS
      value: 8 256k
Copy the code

Nginx-ingress-controller Nginx-Ingress-Controller

proxy-buffer-size: "128k"
Copy the code

Note: Nginx-Ingress-Controller is configured from the corresponding configMap.

Added a request Body size limit

Kong error log

a client request body is buffered to a temporary file /usr/local/kong/client_body_temp/0000000006
Copy the code

Kong Added parameter Settings

- name: KONG_CLIENT_BODY_BUFFER_SIZE
  value: 1024k
Copy the code

Nginx added parameter configuration

client-body-buffer-size: "1024k"
Copy the code