Timeout when uploading a large file?

懵懂的女人 提交于 2019-12-06 19:32:02

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/7348935/timeout-when-uploading-a-large-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!