博客
关于我
nginx upload module安装及使用
阅读量:597 次
发布时间:2019-03-07

本文共 1041 字,大约阅读时间需要 3 分钟。

下载

下载最新版本的Nginx压缩服务器软件。您可以通过官方网站或包管理器获取安装包,确保选择适合您的操作系统版本。

安装

./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中集成Lua脚本进行文件上传处理,确保每个步骤都与实际服务器环境相符。

转载地址:http://jrlcz.baihongyu.com/

你可能感兴趣的文章
Nginx + uWSGI + Flask + Vhost
查看>>
Nginx - Header详解
查看>>
nginx - thinkphp 如何实现url的rewrite
查看>>
Nginx - 反向代理、负载均衡、动静分离、底层原理(案例实战分析)
查看>>
Nginx - 反向代理与负载均衡
查看>>
nginx 1.24.0 安装nginx最新稳定版
查看>>
nginx 301 永久重定向
查看>>
nginx connect 模块安装以及配置
查看>>
nginx css,js合并插件,淘宝nginx合并js,css插件
查看>>
Nginx gateway集群和动态网关
查看>>
nginx http配置说明,逐渐完善。
查看>>
Nginx keepalived一主一从高可用,手把手带你一步一步配置!
查看>>
Nginx Location配置总结
查看>>
Nginx log文件写入失败?log文件权限设置问题
查看>>
Nginx Lua install
查看>>
nginx net::ERR_ABORTED 403 (Forbidden)
查看>>
vue中处理过内存泄露处理方法
查看>>
Nginx RTMP 模块使用指南
查看>>
Nginx SSL 性能调优
查看>>
Nginx SSL私有证书自签,且反代80端口
查看>>