解决nginx上传模块nginx_upload_module传递GET参数
解决nginx上传模块nginx_upload_module传递GET参数的方法总结
最近用户反映我们的系统只能上传50M大小的文件, 希望能够支持上传更大的文件。
很显然PHP无法轻易实现大文件上传, 因为会有各种各样的郁闷问题, 比如服务器超时等, 那么如何解决呢? 我想到了nginx_upload_module!!!
如何安装nginx_upload_module? 请看这里:nginx_upload_module安装使用教程
解决了大文件上传之后又遇到了新问题, 我们希望通过nginx_upload_module给后台php处理程序以GET方式传输数据(当然nginx_upload_module支持POST数据传递, 却不支持GET)
下面我解决nginx_upload_module使用GET传参的方法公布出来,希望能够帮助到和我一样需求的朋友!
修改nginx配置文件(程序站点配置文件test.conf)
|
1
2
3
4
5
6
7
|
location /upload_waynerqiu {upload_pass_args on;upload_resumable on;upload_pass /up_test.php?$args;#此处省略掉详细配置…#如需要详细的参考可查看http://waynerqiu.com/7/136.html} |
html表单代码(up_test.php,此页面即作为表单页同时也负责nginx_upload_module回调页面)
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
<html><head><title>Test upload</title></head><body> <?phpprint_r($_REQUEST);?><h2>Select files to upload</h2><form enctype='multipart/form-data' action='/upload_waynerqiu?who=abc&she=def' method='post'><input type='file' name='file1'><br> <input type='submit' name='submit' value='Upload'><input type='hidden' name='test' value='value'></form><a href='/up_test.php'>back</a></body></html> |
从以上两段代中我们可以看出我试使用/upload_waynerqiu?who=abc&she=def 将who=abc&she=def传递到 后台nginx回调程序 up_test.php中, 这个过程中我使用了nginx变量 $args(更多nginx变量请看这里:http://waynerqiu.com/7/138.html)。
经过测试之后发现参数可以完美的传递来了!

上图中红线部分即为使用nginx_upload_module传递过来的参数!
解决nginx上传模块nginx_upload_module传递GET参数的更多相关文章
- nginx上传模块nginx_upload_module和nginx_uploadprogress_module模块进度显示,如何传递GET参数等。
ownload:http://www.grid.net.ru/nginx/download/nginx_upload_module-2.2.0.tar.gzconfigure and make : . ...
- nginx上传模块nginx_upload_module使用
1.安装模块 1 cd /data/software 2 wget http://www.grid.net.ru/nginx/download/nginx_upload_module-2.0.12.t ...
- nginx上传模块—nginx upload module-
一. nginx upload module原理 官方文档: http://www.grid.net.ru/nginx/upload.en.html Nginx upload module通过ngin ...
- luajit+nginx+上传模块+lua模块编译安装
git clone https://github.com/fdintino/nginx-upload-module.git git clone https://github.com/openresty ...
- Nginx的Upload上传模块
前段时间做一个项目,需要上传文件,差不多需要20M左右,普通用php处理会比较麻烦,经常超时,而且大量占用资源.于是搜索了下,决定用nginx的upload上传模块来处理. 你可以在这里:http:/ ...
- Nginx Upload Module 上传模块
传统站点在处理文件上传请求时,普遍使用后端编程语言处理,如:Java.PHP.Python.Ruby等.今天给大家介绍Nginx的一个模块,Upload Module上传模块,此模块的原理是先把用户上 ...
- nginx上传文件时 nginx 413 Request Entity Too Large 错误
产生原因: 上传文件的大小超出了 Nginx 允许的最大值,默认是1M: 解决方法: 修改Nginx的配置文件(一般是:nginx/nginx.conf),在 http{} 段中增大nginx上传文件 ...
- 解决wordpress上传文件出现http错误问题
解决wordpress上传文件出现http错误问题 问题现象 今天上传约1.4m大小的gif文件到wordpress的媒体库时失败,提示http错误. 原因 由于之前一直上传图片都是可以的,所以推测最 ...
- 基于SpringBoot从零构建博客网站 - 设计可扩展上传模块和开发修改头像密码功能
上传模块在web开发中是很常见的功能也是很重要的功能,在web应用中需要上传的可以是图片.pdf.压缩包等其它类型的文件,同时对于图片可能需要回显,对于其它文件要能够支持下载等.在守望博客系统中对于上 ...
随机推荐
- WSGI的理解
Python web开发中,服务端程序可分为2个部分: 服务器程序(用来接收.整理客户端发送的请求) 应用程序(处理服务器程序传递过来的请求) 在开发应用程序的时候,我们会把常用的功能封装起来,成为各 ...
- ZOJ 3745 Salary Increasing
Description Edward has established a company with n staffs. He is such a kind man that he did Q time ...
- Taurus.MVC
开源:Taurus.MVC 框架 为什么要创造Taurus.MVC: 记得被上一家公司忽悠去负责公司电商平台的时候,情况是这样的: 项目原版是外包给第三方的,使用:WebForm+NHibernate ...
- MySQL--连接属性
The capability flags are used by the client and server to indicate which features they support and w ...
- c# List集合排序
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- 使用Calendar增加日期
/** * @Description: 当前日期加上n个月返回long date */ public static long getLongDateAddMonth(int n){ Calendar ...
- JavaSctipr 兼容、技巧、牛角尖
关于JavaSctipt的兼容性,最懒的办法就是用jQuery的工具函数.尽量不要用那些什么ECMAScript之类的函数,因为很多浏览器都会报找不到函数的错误.下面列出一些在开发过程中碰到过的jav ...
- SmartBusinessDevFramework架构设计-3:考虑开源?
掖着藏着,终归不是好的办法.说的跟花一样,究竟里子是什么东西.一个好的被子,里料是羽绒还是棉花还是丝绵还是黑心棉?有时候,真的是看过之后,才能体验其中的奥秘. 这个架构的设计初衷,总体是为了方便.ne ...
- 【Xamarin挖墙脚系列:关闭 OS X El Capitan 中 SIP 安全设置功能】
比如需要修改内核配置文件: com.apple.Boot.plist 那么我们需要解锁权限. 禁止SIP模式,那么就可以修改此文件了. 在 OS X El Capitan 中有一个跟安全相关的模式叫 ...
- (?:pattern) (?=pattern) (?!pattern)
(pattern) 匹配 pattern 并获取这一匹配.所获取的匹配可以从产生的 Matches 集合得到,在VBScript 中使用 SubMatches 集合,在JScript 中则使用 $0- ...