大网数据广告活动
服务器运维问答

nginx - client request body is buffered to a temporary file

· 52CE 我爱测

I get the following error in my log files every time I try to upload a large file. a client request body is buffered to a temporary file /var/lib/nginx/body/0000000001 Although the file uploads successfully, I always get the abov…

问题原文

原帖链接 · Abs · CC BY-SA 3.0

I get the following error in my log files every time I try to upload a large file.

a client request body is buffered to a temporary file /var/lib/nginx/body/0000000001

Although the file uploads successfully, I always get the above error.

I increased the client_body_buffer_size to 1000m which is what I expect the largest file uploaded to be. However, this is was just a guess and although I don't get that error anymore I am wondering if this is an appropriate value to set for the client_body_buffer_size?

I would appreciate it if anyone can shed some light on this directive and how it should be used.

社区高分解答

原帖链接 · eddy85br · CC BY-SA 3.0

If you don't want to NginX store the body content in a temporary file, you can set your config. like this:

    client_body_buffer_size     10M;
    client_max_body_size        10M;

If you set both of this configurations at the same max. size (in k, M or G for kB, MB or GB, respectively), you will prevent that NginX creates a temp. file.

For more info: http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_buffer_size and http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-05-29)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。