博客
关于我
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/

你可能感兴趣的文章
Nacos 单机集群搭建及常用生产环境配置 | Spring Cloud 3
查看>>
Nacos 启动报错[db-load-error]load jdbc.properties error
查看>>
Nacos 报Statement cancelled due to timeout or client request
查看>>
Nacos 注册服务源码分析
查看>>
Nacos 融合 Spring Cloud,成为注册配置中心
查看>>
Nacos-注册中心
查看>>
Nacos2.X 源码分析:为订阅方推送、服务健康检查、集群数据同步、grpc客户端服务端初始化
查看>>
Nacos2.X 配置中心源码分析:客户端如何拉取配置、服务端配置发布客户端监听机制
查看>>
Nacos2.X源码分析:服务注册、服务发现流程
查看>>
NacosClient客户端搭建,微服务注册进nacos
查看>>
Nacos中使用ribbon
查看>>
Nacos使用OpenFeign
查看>>
Nacos使用Ribbon
查看>>
Nacos做注册中心使用
查看>>
Nacos做配置中心使用
查看>>
Nacos入门过程的坑--获取不到配置的值
查看>>
Nacos原理
查看>>
Nacos发布0.5.0版本,轻松玩转动态 DNS 服务
查看>>
Nacos启动异常
查看>>
Nacos命名空间配置_每个人用各自自己的命名空间---SpringCloud Alibaba_若依微服务框架改造---工作笔记001
查看>>