client_max_body_size is not working in kubernetes docker container

9/3/2020

We have different pod for different apps like for node app have diffenent pod and UI app have different pod, UI app is running in nginx server pod. we are accessing the apis using service and that we config in nginx config file. we are not able to upload the 2mb file size from UI, getting the 413 status code error.

413 Request Entity Too Large 413 Request Entity Too Large nginx/1.17.10

We have added the client_max_body_size in /etc/nginx/conf.d/default.conf default.conf in server directive
server {

client_max_body_size 200M;

location / {
    client_max_body_size 200M;
    client_body_buffer_size    100M;
}

}

same code is working without docker container. Technologies Used 1. UI - Reactjs - Axios - hosted in nginx server 2. Nodejs 3. kubernetes 4. docker 5. SSL 6. GCP

-- Balaji
docker
google-cloud-platform
kubernetes
nginx

0 Answers