Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Timeout when uploading a large file?

I am running a Django app on a Linux platform with gunicorn and Nginx. I allow users to upload a CSV file (approx 2MB) which the app processes and adds to the backend database. The problem is for large files something seems to be timing out after around 2 or 3 minutes and a page entitled 404 Not Found nginx/0.7.6 is displayed. The URL does not change however - i.e., it remains as the URL to the file upload page of my app.

The Nginx error log shows:

2011/09/08 13:28:05 [error] 1349#0: *303 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 213.146.112.122, server: _, request: "POST /app/import_csv/ HTTP/1.1", upstream:

Any ideas what's happening? How can I increase this timeout?

like image 232
dougv Avatar asked Sep 08 '11 13:09

dougv


1 Answers

I added:

proxy_read_timeout 1200;

to nginx.conf. This increased the timeout from the default which fixed the problem. I probably don't need to use 1200, it's just the first value I tried.

like image 139
dougv Avatar answered Oct 16 '22 12:10

dougv