First I try to set the buffer same, but it's not working:
client_body_buffer_size 10M;
client_max_body_size 10M;
Reference:http://serverfault.com/questions/511789/nginx-client-request-body-is-buffered-to-a-temporary-file
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: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
Syntax: client_max_body_size size;
Default:
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