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)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Engage with a sea of insights in this enlightening article, highly esteemed within the encouraging DEV Community. Programmers of every skill level are invited to participate and enrich our shared knowledge.

A simple "thank you" can uplift someone's spirits. Express your appreciation in the comments section!

On DEV, sharing knowledge smooths our journey and strengthens our community bonds. Found this useful? A brief thank you to the author can mean a lot.

Okay