Monday, April 4, 2016

Nginx Buffer messages in log keeps POST requests how to turned it off

2016/04/04 12:38:22 [warn] 1753#0: *512 a client request body is buffered to a temporary file /var/cache/nginx/client_temp/0000000044, client:, server:, request: "POST /wp-admin/async-upload.php HTTP/1.1", host: "", referrer: ""

First I try to set the buffer same, but it's not working:

    client_body_buffer_size     10M;
client_max_body_size 10M;


Then I try to increase the size of the buffer only for /wp-admin:

location /wp-admin {
client_body_buffer_size 100M;

Still not luck.

At last I go to Nginx's doc site:

Syntax:	client_max_body_size size;
client_max_body_size 1m;
Context: http, server, location
Sets the maximum allowed size of the client request body, specified in the “Content-Length” request header field. If the size in a request exceeds the configured value, the 413 (Request Entity Too Large) error is returned to the client. Please be aware that browsers cannot correctly display this error. Setting size to 0 disables checking of client request body size.

If you want to ensure that the client request body is not buffered to
disk, you want to make sure that your client_body_buffer_size is larger
than your client_max_body_size. And be willing to refuse any client
request body bigger than that.

client_max_body_size  0;

So this is what my nginx vhost config file looks like:

client_body_buffer_size 10M;
client_max_body_size 0;

No comments:

Post a Comment