DEV Community

drake
drake

Posted on

自建的git远程仓库,在push时413 Request Entity Too Large

  • 问题的原因就是push 的文件太大了,导致失败

但是这只是表象,其本质原因是在Nginx配置问题

  • 我这里git remote add origin xxx 添加的远程仓库地址是https协议的,走Nginx

  • 而Nginx默认的配置是指接受请求体小于1M的请求

也就是说,如果你不在Nginx的启动配置文件`中显示指定 client_max_body_size 500M; `这一行配置,那么就会导致下面的报错

413 Request Entity Too Large

  • 如果有多层的Nginx转发,那么每一层的Nginx都得配置这一行参数

  • Nginx默认1M着实有点SB

Top comments (0)

Heroku

This site is built on Heroku

Join the ranks of developers at Salesforce, Airbase, DEV, and more who deploy their mission critical applications on Heroku. Sign up today and launch your first app!

Get Started

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay