2 Star 1 Fork 1

mirrors_winshining / nginx-upload-module

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

nginx-upload-module

This module is based on Nginx upload module (v 2.2.0) http://www.grid.net.ru/nginx/upload.en.html. ... Since it seems the author has not maintained that module. I changed some codes that can be installed with latest nginx.

  • note

When compiled with nginx-1.11.2 and later versions, if https is needed, please add configuration option --with-http_ssl_module.

  • 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;
    }
}

空文件

简介

暂无描述 展开 收起
C 等 2 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/mirrors_winshining/nginx-upload-module.git
git@gitee.com:mirrors_winshining/nginx-upload-module.git
mirrors_winshining
nginx-upload-module
nginx-upload-module
master

搜索帮助