ngin upload module安装及使用

下载

https://github.com/vkholodkov/nginx-upload-module/archive/2.2.zip

安装

./configure --prefix=/opt/yliyun/openresty--add-module=/opt/nginx_upload_module-2.2.0
make
make install

nginx配置

# upload settings
upload_pass_args on;
upload_limit_rate 100m;
upload_store /opt/yliyun/temp;
upload_set_form_field $upload_field_name.name "$upload_file_name";
upload_set_form_field $upload_field_name.path "$upload_tmp_path";
upload_aggregate_form_field "$upload_field_name.md5" "$upload_file_md5";
upload_aggregate_form_field $upload_field_name.crc32 $upload_file_crc32;
upload_aggregate_form_field "$upload_field_name.size" "$upload_file_size";
upload_pass_form_field "param";
upload_cleanup 200-299 400-499 500-505;

    location = /apps/upload/file {
        proxy_set_header x-real-ip $remote_addr;
        upload_pass @lua-upload;
    } 

    location @lua-upload {
        default_type 'application/json;charset=utf-8';
        content_by_lua_file /opt/yliyun/work/lua/upload/single_upload.lua;
    }

关键字:Nginx, upload, openresty

版权声明

本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处。如若内容有涉嫌抄袭侵权/违法违规/事实不符,请点击 举报 进行投诉反馈!

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部