問題
1〜2MBのファイルのアップロードは正常に機能します。16MBのファイルをアップロードしようとすると、数秒後に502エラーが発生します
より詳細:
- 「アップロード」をクリックします
 - Google Chromeがファイルをアップロードします(アップロードステータスは左下隅で0%から100%に変化しています)
 - ステータスが「WaitingforHOST」に変わります。ここで、HOSTは私のサイトのホスト名です。
 - 30分後、サーバーは「502BadGateway」を返します
 
私の見解:
def upload(request):
    if request.method == 'POST':
        f = File(data=request.FILES['file'])
        f.save()
        return redirect(reverse(display),  f.id)
    else:
        return render('filehosting_upload.html', request)
render(template、request [、data])は、いくつかのajaxのものを扱う私自身の省略形です。
filehosting_upload.html:_
{% extends "base.html" %}
{% block content %}
    <h2>File upload</h2>
    <form action="{% url nexus.filehosting.views.upload %}" method="post" enctype="multipart/form-data">
        {% csrf_token %}
        <input type="file" name="file">
        <button type="submit" class="btn">Upload</button>
    </form>
{% endblock %}
ログと仕様
私が見つけることができるログには何も有益なものはありません。
バージョン:
- Django == 1.4.2
 - Nginx == 1.2.1
 - gunicorn == 0.17.2
 
コマンドラインパラメータ
command=/var/www/ernado/data/envs/PROJECT_NAME/bin/gunicorn -b localhost:8801 -w 4 PROJECT_NAME:application
関連する場所のNginx構成:
   location /files/upload {
    client_max_body_size 100m;
    proxy_pass http://HOST;
    proxy_connect_timeout 300s;
    proxy_read_timeout 300s;
   }
Nginxログエントリ(MY_IPとHOSTを変更)
2013/03/23 19:31:06 [error] 12701#0: *88 upstream prematurely closed connection while reading response header from upstream, client: MY_IP, server: HOST, request: "POST /files/upload HTTP/1.1", upstream: "http://127.0.0.1:8801/files/upload", host: "HOST", referrer: "http://HOST/files/upload"
Djangoログ
2013-03-23 19:31:06 [12634] [CRITICAL] WORKER TIMEOUT (pid:12829)
2013-03-23 19:31:06 [12634] [CRITICAL] WORKER TIMEOUT (pid:12829)
2013-03-23 19:31:06 [13854] [INFO] Booting worker with pid: 13854
質問
- それを修正する方法は?
 - nginxアップロードモジュールなしでそれを修正することは可能ですか?
 
更新1 提案された構成を試しました
 gunicorn --workers=3 --worker-class=tornado  --timeout=90 --graceful-timeout=10 --log-level=DEBUG --bind localhost:8801 --debug
今はうまくいきます。