Nginx反向代理上传大文件报错(failed to load resource : net :: ERR_CONNECTION_RESET)

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

经查是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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值