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?

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top