Git提交代码Push的时候报错HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large

1 篇文章 0 订阅

 

首先看看我提交代码的时候,报错的信息:

git.exe push --progress "origin" master:master

Counting objects: 43142, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (25108/25108), done.
Writing objects: 100% (43142/43142), 824.64 MiB | 26.18 MiB/s, done.
Total 43142 (delta 14030), reused 43141 (delta 14030)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413 Request Entity Too Large
Everything up-to-date


git did not exit cleanly (exit code 1) (717417 ms @ 2016/11/1 15:57:57)

 

网络上给了几个解决方法:

1、https://www.cnblogs.com/feiyujun/p/7755764.html

2、http://www.cnblogs.com/lihaiping/p/6021813.html

 

我后面找到了另外的一个解决方法:

因为我用了nginx做代理,是因为nginx转发时限制了。

我在nginx配置文件中新增一个配置解决问题:

配置如下:

client_max_body_size 50m;#客户端上传文件最大限制,默认是1m

 

可以选择在http{ }中设置:client_max_body_size   20m;

 也可以选择在server{ }中设置:client_max_body_size   20m;

还可以选择在location{ }中设置:client_max_body_size   20m;

三者到区别是:http{} 中控制着所有nginx收到的请求。而报文大小限制设置在server{}中,则控制该server收到的请求报文大小,同理,如果配置在location中,则报文大小限制,只对匹配了location 路由规则的请求生效。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值