How do I configure the NGINX Ingress Controller to increase the client request body, activate CORS to allow additional headers, and use WebSocket to work with Amazon EKS?
2 minute read
I want to configure the NGINX Ingress Controller to increase the size of the client request body with my Amazon Elastic Kubernetes Service (Amazon EKS) cluster. I also want to activate Cross-Origin Resource Sharing (CORS) to allow additional headers, and use WebSocket with the NGINX Ingress Controller.
Choose one of the following configuration options:
To increase the size of the client request body, complete the steps in the Configure maximum body size section.
To activate CORS to allow additional headers, complete the steps in the Activate CORS section.
To use WebSocket with the NGINX Ingress Controller, complete the steps in the Use WebSocket section.
Configure maximum body size
If your body size request exceeds the maximum allowed size of the client request body, then the NGINX Ingress Controller returns an HTTP 413 error. Use the client_max_body_size parameter to configure a larger size:
Note: The default value of the proxy-body-size is 1 M. Make sure to change the number to the size you need.
Note: In some cases, you might need to increase the maximum size for all post body data and file uploads. For PHP, you must increase the post_max_size and upload_max_file_size values in the php.ini configuration.
To activate CORS in an Ingress rule, add the following annotation:
The following example shows that header X-Forwarded-For is accepted: