使用nginx代理gogs遇到推送代码错误的问题(RPC failed; HTTP 413 curl 22 The requested URL returned error: 413)

前提

  代码管理我是用Gogs.Git,前些阵子使用Nginx将git.balabiu.com反向代理到了Gogs的默认端口,其余二级域名准备作其余使用,git

致使上报代码出现了错误。curl

问题

  推送代码报错误post

error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
fatal: the remote end hung up unexpectedly
fatal: the remote end hung up unexpectedly

 

 

解决

  查了一下413错误,查到   ”经过post上传文件过大时,会出现413错误码“    ,初步肯定了是Nginx配置致使的。url

  因而百度了一波Nginx,设置 client_max_body_size 参数能够修改上传文件大小限制。spa

  

server{
    listen 80;
       server_name git.balabiu.com;
       client_max_body_size 100m;
       location /{
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header Host $http_host;
            proxy_pass http://127.0.0.1:5100;
        }
}

  从新推送代码,问题解决。代理

相关文章
相关标签/搜索