转自:
https://blog.youkuaiyun.com/kinginblue/article/details/50753271?locationNum=14&fps=1
Nginx反向代理上传大文件报错(failed to load resource : net :: ERR_CONNECTION_RESET)
http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size
正文
当使用Nginx反向代理上传大文件报错
failed to load resource : net :: ERR_CONNECTION_RESET
1
经查是Nginx的配置问题。
使用
client_max_body_size size;
1
用于配置请求中Body的最大可允许值。size的单位为M,Nginx默认的设置是1m。数值按需自行设置即可。例如限制为1G:
client_max_body_size 1024m;
1
此配置可放在 http | server | location 任一处,对应不同的作用范围。
附
官方文档说明:
Syntax: client_max_body_size size;
Default: client_max_body_size 1m;
Context: http, server, location
1
2
3
Sets the maximum allowed size of the client request body, specified in the “Content-Length” request header field.