`
happyqing
  • 浏览: 3183711 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

nginx上传模块下载安装

阅读更多

 

Nginx下载地址,英文文档

http://happyqing.iteye.com/blog/1806478

上传模块下载地址

http://www.grid.net.ru/nginx/upload.en.html

http://www.grid.net.ru/nginx/download/nginx_upload_module-2.2.0.tar.gz

 

Nginx-1.3.X,Nginx-1.4.X安装nginx_upload_module-2.2.0.tar.gz会有点问题,报

/opt/nginx_upload_module-2.2.0/ngx_http_upload_module.c: In function ‘ngx_http_read_upload_client_request_body’:
/opt/nginx_upload_module-2.2.0/ngx_http_upload_module.c:2628: 错误:‘ngx_http_request_body_t’ 没有名为 ‘to_write’ 的成员

 

选择Nginx-1.2.X的就没问题。

 

安装方法

cd <path to nginx sources>
./configure --add-module=<path to upload module sources>
make
make install

 

[root@dev opt]# tar xvzf nginx_upload_module-2.2.0.tar.gz

[root@dev opt]# cd /opt/nginx-1.2.9

[root@dev nginx-1.2.9]# ./configure --add-module=/opt/nginx_upload_module-2.2.0

[root@dev nginx-1.2.9]# make

[root@dev nginx-1.2.9]# make install

 

上传会涉及权限问题,nginx要写临时文件,要注意nginx的启动用户是否具有对相应目录的操作权限

有问题看日志

nginx.conf

user root

 

Example configuration

server {
    client_max_body_size 100m;
    listen       80;

    # Upload form should be submitted to this location
    location /upload {
        # Pass altered request body to this location
        upload_pass   @test;

        # 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 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$";

        upload_cleanup 400 404 499 500-505;
    }

    # Pass altered request body to a backend
    location @test {
        proxy_pass   http://localhost:8080;
    }
}
        

Example form

<html>
<head>
<title>Test upload</title>
</head>
<body>
<h2>Select files to upload</h2>
<form name="upload" method="POST" enctype="multipart/form-data" action="/upload">
<input type="file" name="file1"><br>
<input type="file" name="file2"><br>
<input type="file" name="file3"><br>
<input type="file" name="file4"><br>
<input type="file" name="file5"><br>
<input type="file" name="file6"><br>
<input type="submit" name="submit" value="Upload">
<input type="hidden" name="test" value="value">
</form>
</body>
</html>

 

 文档参考:

http://blog.csdn.net/langeldep/article/details/8755613

http://www.ttlsa.com/html/1448.html

分享到:
评论

相关推荐

    Nginx文件上传模块配置

    总结来说,配置Nginx的文件上传功能涉及下载和编译第三方模块,修改Nginx配置文件以处理上传请求和进度查询,最后通过客户端与服务器的交互实现文件的上传和进度反馈。这个过程需要理解Nginx的工作原理以及如何与...

    Nginx模块源码 nginx-notice-2

    1. **获取源码**:下载Nginx 0.7的源码,以及"nginx-notice-2"模块的源码。 2. **配置Nginx**:在Nginx源码目录中,运行`./configure`,并在参数中添加模块路径,如`--add-module=path/to/nginx-notice-2`。 3. **...

    nginx各版本源码包

    Nginx 是一款高性能的 Web 和反向代理服务器,广泛应用于互联网行业中,以其高效的并发处理能力、低内存占用和丰富的模块支持而备受青睐。本压缩包提供了 Nginx 的四个不同版本源码,包括 nginx-1.17.6.tar.gz、...

    nginx-upload-module模块源码

    nginx-upload-module模块源码,用于nginx配置文件上传功能

    nginx上传下载之nginx-upload-module-2.3.0

    Nginx Upload Module 是一个用于 Nginx 的第三方模块,它允许用户在通过 HTTP 协议上传大文件时进行处理,例如分块上传、限速、断点续传等。这个模块对于构建支持大文件上传的 Web 应用非常有用,特别适用于文件分享...

    nginx手动安装【包含安装脚本】

    将包含有Nginx安装文件的压缩包上传到服务器是安装过程的第一步。通常,这可以通过FTP、SCP或者使用文件传输工具如rsync来完成。确保文件安全地传输到服务器的适当目录,例如 `/home` 或 `/opt`。 解压压缩包是接...

    Nginx服务器的安装与配置.pdf

    Nginx模块.pdf Nginx指南.pdf 第1章 Nginx简介.pdf 第2章 Nginx服务器的安装与配置.pdf 第3章 Nginx的基本配置与优化.pdf 第4章 Nginx与PHP(FastCGI)的安装、配置与优化.pdf 第5章 Nginx与JSP、ASP.NET、Perl的安装...

    Redhat下Fastdfs安装配置及nginx模块安装配置文档.pdf

    首先安装Nginx,然后下载FastDFS的Nginx模块源码,将其编译进Nginx。在Nginx配置文件中添加FastDFS的配置项,如`fastdfs.conf`,并指定Tracker Server的IP和端口。 8. 配置Nginx: 在Nginx的配置文件中,包含...

    nginx流媒体安装包(nginx_mod_h264_streaming,yamdi)

    通过安装这个模块,我们可以让Nginx成为一个强大的流媒体服务器。 1. 安装Nginx - 首先,你需要在你的服务器上安装基础的Nginx。对于Linux系统,可以使用包管理器(如apt-get或yum)来安装。 ``` sudo apt-get ...

    Nginx与Nginx-GridFS的安装与配置

    **Nginx与Nginx-GridFS的安装与配置** Nginx是一款高性能的HTTP和反向代理服务器,以其轻量级、高并发、稳定性好而被广泛应用于Web服务领域。Nginx-GridFS是Nginx的一个模块,用于提供对MongoDB的GridFS存储系统的...

    nginx的php模块ngx_php.zip

    ngx_php功能是为nginx模块嵌入php脚本语言。别名为php-nginx-module。 特性 * 支持加载php.ini配置文件 * 支持原生php的全局变量$_GET, $_POST, $_COOKIE, $_SERVER, $_FILES, $_SESSION... * 支持运行php代码...

    linux下Nginx+tomcat整合的安装与配置

    ### Linux下Nginx+Tomcat整合的安装与配置详解 在现代的Web服务器架构中,Nginx作为高性能的反向代理服务器和负载均衡器,常被用来与Tomcat等应用服务器配合使用,以提高网站的响应速度、稳定性和安全性。本文将...

    fastdfs-nginx-module-1.24

    FastDFS-nginx-module 1.24 是一个针对 FastDFS 文件系统的 Nginx 模块,它使得 Nginx 可以无缝地与 FastDFS 集成,提供了高效的文件上传、下载服务。这一版本是针对 FastDFS 的最新更新,旨在优化性能,提高稳定性...

    Nginx文件上传进度显示

    在文件上传方面,Nginx 提供了一个强大的模块——`nginx_uploadprogress_module`,用于跟踪和显示文件上传进度。这对于提高用户体验至关重要,尤其是在上传大型文件或网络连接不稳定的情况下。 #### 二、模块安装与...

    nginxWindows版,自带rtmp服务模块

    7. **临时文件**:`temp`目录用于存放Nginx处理过程中产生的临时文件,如缓存和上传文件。 8. **Lua支持**:`lua51.dll`可能表示Nginx集成了Lua脚本支持,允许通过Lua脚本来扩展Nginx的功能,如动态配置、日志处理...

    nginx-module-vts.tar.gz

    1. **安装Nginx-Module-VTS**:首先,解压`nginx-module-vts.tar.gz`,然后按照其README文档指示编译并安装Nginx,确保Nginx配置文件中加载了该模块。 2. **配置Nginx**:在Nginx的配置文件中,为每个需要监控的...

    linux下安装nginx

    下载完成后,将其上传到 Linux 服务器上。 使用以下命令授权和解压 Nginx: ``` chmod -R 775 nginx.tar.gz gunzip nginx.tar.gz tar -xf nginx.tar ``` 配置 Nginx 解压完成后,进入 Nginx 目录,并执行以下命令...

    nginx-upload-progress模块源码

    `nginx-upload-progress` 模块就是这样一种解决方案,它允许 Nginx 在处理文件上传时返回实时的上传进度信息。 **模块介绍** `nginx-upload-progress` 模块是专为 Nginx 设计的,用来跟踪并报告文件上传的进度。这...

    Nginx+upload+lua实现简单文件上传服务

    本教程将详细解析如何使用Nginx、upload模块以及lua来搭建一个简单的文件上传系统。 首先,我们需要了解Nginx的ngx_http_upload_module模块,这是一个用于处理HTTP POST请求中的文件上传的第三方模块。它允许我们在...

Global site tag (gtag.js) - Google Analytics