22

I'm currently hosting a django project on Apache + nginx. When I try to upload a large file I get a 413 request entity too large error message.

413 request entity too large

I also have a django-cms project and when I tried to upload a file which is anything over 5meg I get an error code 64, The web server connection was closed.

code 64 the web server connection was closed

Thanks in advance,

darren
  • 18,845
  • 17
  • 60
  • 79

1 Answers1

52

Your error message tells it comes from nginx configuration.

You need to increase client_max_body_size on your nginx.conf server config. eg :

http {
    server {
        client_max_body_size 20M;
        listen       80;
        server_name  test.com;
    }
}
jujule
  • 11,125
  • 3
  • 42
  • 63
  • 1
    I didn't add it to the nginx.conf. I added it to the proxy.conf as we're running a reverse proxy server. Worked great. – darren Feb 15 '11 at 18:35
  • I found a complement for this solution on http://cnedelcu.blogspot.com.br/2013/09/nginx-error-413-request-entity-too-large.html – mondaini Jul 10 '16 at 14:09