nginx 文件上传模块测试

本文档详细记录了在Nginx中测试文件上传功能的步骤,包括配置nginx源码、添加上传模块、修改配置文件以允许上传,并通过curl进行文件上传测试,最后验证文件存储情况。
摘要由CSDN通过智能技术生成

只是为了研究nginx的文件上传功能,做了如下的一些功能测试。

1.下载 nginx_upload_module-2.2.0,解压放置目录 /home/ffair/upload

2.下载nginx 源码 1.5.2版本

3.安装 nginx

./configure --prefix=/home/ffair/install/ngx --add-module=/home/ffair/upload/nginx_upload_module-2.2.0

make

make install

4.修改nginx的配置文件如下

http {
    include       mime.types;
    default_type  application/octet-stream;

    server {
        listen       5000;
        client_max_body_size 100m;

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

            # Store files to this directory
            # The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist

           #设置文件上传的存储目录
            u

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值