使用nginx代理gogs遇到推送代碼錯誤的問題(RPC failed; HTTP 413 curl 22 The requested URL returned error: 413)


前提

  代碼管理我是用Gogs.Git,前些陣子使用Nginx將git.balabiu.com反向代理到了Gogs的默認端口,其他二級域名准備做其他使用,

導致上報代碼出現了錯誤。

問題

  推送代碼報錯誤

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配置導致的。

  於是百度了一波Nginx,設置 client_max_body_size 參數可以修改上傳文件大小限制。

  

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;
        }
}

  重新推送代碼,問題解決。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM