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 toload resource : net :: err_connection_reset
经查是nginx的配置问题。
使用
client_max_body_size size;
用于配置请求中body的最大可允许值。size的单位为m,nginx默认的设置是1m。数值按需自行设置即可。例如限制为1g:
client_max_body_size 1024m;
此配置可放在 http | server | location 任一处,对应不同的作用范围。
附
官方文档说明:
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.
‘).addclass(‘pre-numbering’).hide();
$(this).addclass(‘has-numbering’).parent().append($numbering);
for (i = 1; i