nginx – How to fix “a client request body is buffered to a temporary file”?
Ia have a container running in the google cloud with a Mysql Db in the same cloud. It receives json data via an API. when the data is processed I write data in the db.
About twice in 5 min I get the following log entry:
2023/11/27 12:27:09 [warn] 15#15: *39 a client request body is buffered to a temporary file /var/lib/nginx/client_body_temp/0000000020,
which, although it is only a warning, arrives as an error in my log. So it spams my log with errors and I want to get rid of it.
I have not much experience with nginx yet so I looked up the value “client_body_buffer_size” and found that it is part of a proxy.conf
My setup hasn’t got a proxy configuration yet so I added a simple one:
proxy.conf and placed it in the Docker build script at /etc/nginx/proxy.conf
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
client_max_body_size 1m;
client_body_buffer_size 1m;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;
After that my annoying error was gone, but I had a much worse error: I got “Operation timeout” errors from my database and my data could not be written anymore. So of course I reverted that configuration and removed proxy.conf and now I am back to the first error.
What is the proper way and place to get rid of the the error on the heading? Can I add the client_body_buffer_size parameter to the httpd.conf instead?
I should add, that the data sent back is not big like images. It might have the size of 250kb, maybe a bit bigger.
I already asked the question on the sister site: stackoverflow.com/questions/77556980/how-to-fix-a-client-request-body-is-buffered-to-a-temporary-file
Read more here: Source link
