File upload 为什么赢了';NGINX工作的上传速率是否有限制?

File upload 为什么赢了';NGINX工作的上传速率是否有限制?,file-upload,nginx,File Upload,Nginx,我正在本地机器上使用nginx上传模块和上传进度模块进行一些测试。因为我是本地人,上传几乎是即时的,因此很难测试和调试上传进度模块 我已根据以下文档将指令:upload\u limit\u rate 8k添加到我的nginx上载块: 在所有这些之后,上传一个数兆字节的文件仍然是即时的。。。看来 上载速率限制不起作用 这是我的配置块: 可在此处找到完整配置: 位置/上传{ # Pass altered request body to this location upload_pass

我正在本地机器上使用nginx上传模块和上传进度模块进行一些测试。因为我是本地人,上传几乎是即时的,因此很难测试和调试上传进度模块

我已根据以下文档将指令:upload\u limit\u rate 8k添加到我的nginx上载块:

在所有这些之后,上传一个数兆字节的文件仍然是即时的。。。看来 上载速率限制不起作用

这是我的配置块:

可在此处找到完整配置:


位置/上传{

# Pass altered request body to this location
    upload_pass   @unicorn;


    # Store files to this directory
    # The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
    upload_store /Users/kirkquesnelle/Sites/porelo/tmp/uploads 1;

    # Allow uploaded files to be read only by user
    upload_store_access user:r;

    # Set specified fields in request body
    upload_set_form_field $upload_field_name.name "$upload_file_name";
    upload_set_form_field $upload_field_name.content_type "$upload_content_type";
    upload_set_form_field $upload_field_name.path "$upload_tmp_path";

    # Inform backend about hash and size of a file
    upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5";
    upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size";

    upload_pass_form_field "^X-Progress-ID|^authenticity_token|^submit$|^description$";

    upload_cleanup 400 404 499 500-505;

    # Specifies upload rate limit in bytes per second. Zero means rate is unlimited.
    upload_limit_rate 8k;

    track_uploads proxied 30s;
}


我的配置有什么问题吗?为什么这不起作用


谢谢

在执行
上传通行证
指令之前,请尝试设置
上传限制
。作为配置块中的第一行。

在执行
upload\u pass
指令之前,尝试设置
upload\u limit\u rate
。作为配置块中的第一行。

K,感谢您的回复。。我会尝试一下,然后回来。当我尝试调用progress时,我的ajax回调中似乎出现了405个不允许的错误。。有什么想法吗?我看到了你关于这个错误的问题,粘贴php脚本的内容和新的nginx配置,两者都有。我正在使用Rails。但是上传的这一部分工作正常,它只是用Ajax GET请求调用upload_progress_模块。我不喜欢这样称呼它。我将在这里发布我的整个NGINX配置:我想这与我没有正确设置代理\u pass有关..K,感谢您的回复。。我会尝试一下,然后回来。当我尝试调用progress时,我的ajax回调中似乎出现了405个不允许的错误。。有什么想法吗?我看到了你关于这个错误的问题,粘贴php脚本的内容和新的nginx配置,两者都有。我正在使用Rails。但是上传的这一部分工作正常,它只是用Ajax GET请求调用upload_progress_模块。我不喜欢这样称呼它。我将在这里发布我的整个NGINX配置:我认为这与我没有正确设置代理程序有关。。