点赞
评论
收藏
分享
举报
nginx-upload-module
发表于2020-08-21 10:14

浏览 2k

授权协议:
Apache License 2.0
原作者联系方式:
hongzhidao@gmail.com
功能说明:
基于Nginx upload module (v 2.2.0) http://www.grid.net.ru/nginx/upload.en.html进行了维护和更新。因为原作者看起来已经没有再维护这个模块了,洪志道老师做了一些修改使得这个模块可以安装使用在最新的Nginx中。 nginx-upload-module 是一个 Nginx 的扩展模块,用来处理使用 multipart/form-data (RFC1867) 文件上传。

使用配置方式:

  • install ./configure --add-module={module_dir} && make && make install

  • conf

  • server {
        listen       80;
        client_max_body_size 100m;
    
        location / {
            root  html/upload;
        }
    
        # Upload form should be submitted to this location
        location /upload {
            # Pass altered request body to this location
            upload_pass   /example.php;
    
            # Store files to this directory
            # The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
            upload_store /tmp/upload 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 "^submit$|^description$";
        }
    
        location ~ \.php$ {
            root           html/upload;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }

作者联系方式:

          hongzhidao@gmail.com

项目源码连接:

      https://github.com/hongzhidao/nginx-upload-module

项目版权类型:

   Apache License 2.0


已修改于2023-03-08 02:03
创作不易,留下一份鼓励
皮皮鲁

暂无个人介绍

关注



写下您的评论
发表评论
全部评论(0)

按点赞数排序

按时间排序

关于作者
皮皮鲁
这家伙很懒还未留下介绍~
85
文章
2
问答
32
粉丝
相关文章