413 request entity too large + The web server connection was closed | Error 64

darren picture darren · Feb 15, 2011 · Viewed 14.3k times · Source

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,

Answer

jujule picture jujule · Feb 15, 2011

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