外观
请求大小限制
约 161 字小于 1 分钟
2025-08-31
使用nginx
代理gitlab
时,遇到push
时报如下错误:
> git push origin master:master
error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
send-pack: unexpected disconnect while reading sideband packet
fatal: the remote end hung up unexpectedly
Everything up-to-date
- 413 表示"Request Entity Too Large"(请求实体过大)
- 通常是因为你尝试推送的文件或数据包超过了服务器的限制
Nginx
中控制请求体大小的参数为client_max_body_size
,默认1MB
(1048576 bytes),设置为0
表示不限制
因此可以在对应的代理服务下,增加client_max_body_size
大小:
server {
client_max_body_size 1G;
location / {
...
}
}