проблема с закачкой файлов

Vasiliy Tolstov v.tolstov at peterhost.ru
Mon Sep 3 11:09:56 MSD 2007


Пытаюсь закачать файл размеро 3072000 байт. Через форму вида
<form method="post" enctype="multipart/form-data" action="my.php">
<input type="file" name="file">
<input type="submit" value="Submit">
</form>

Файл, my.php делает следующее

if (is_uploaded_file($_FILES['file']['tmp_name'])){
echo "file is uploaded";
}
else {
echo "Error";
}

После ожидания примерно в минуту выдается ошибка
413 Request Entity Too Large
nginx/0.5.7

Конфиг у nginx следующий

user  www www;
worker_processes  2;

error_log  /var/log/nginx-error.log error;
pid        /var/run/nginx.pid;

events {
    worker_connections  2000;
    use kqueue;
}

http {
    include       mime.types;
    default_type  text/html;
    sendfile  on;
    access_log  off;
    large_client_header_buffers 32 16k;
    client_header_buffer_size   2k;
    client_header_timeout  600;
    client_body_timeout    600;
    ignore_invalid_headers off;
    server_names_hash_bucket_size 128;
    server_names_hash_max_size 2048;

    server {
         listen          127.0.0.1:888;
         server_name     localhost;
         access_log      off;
         location = /stub_status {
             stub_status on;
             allow       127.0.0.0/8;
             deny        all;
         }
         location / { deny all; }
    }

    server {
        include listen.conf;
        location / {
            access_log  off;
            proxy_pass  http://127.0.0.1/;

            client_max_body_size       10m;
            client_body_buffer_size    512k;

            proxy_connect_timeout      600;
            proxy_send_timeout         300;
            proxy_read_timeout         300;
            proxy_send_lowat           8191;

            proxy_redirect     off;

            proxy_set_header   Host             $host;

            proxy_set_header   X-Real-IP        $remote_addr;

            proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

            proxy_buffer_size          4k;
            proxy_buffers              4 32k;
            proxy_busy_buffers_size    64k;
            proxy_temp_file_write_size 64k;

            proxy_temp_path            /tmp/nginx;
        }
    }

    include move_user.conf;
    include deny_user.conf;
}





-- 
С уважением, Vasily Tolstov






More information about the nginx-ru mailing list