解决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.压缩包等其它类型的文件,同时对于图片可能需要回显,对于其它文件要能够支持下载等.在守望博客系统中对于上 ...
随机推荐
- [转]MySQL 5.6 全局事务 ID(GTID)实现原理(三)
原文连接:http://qing.blog.sina.com.cn/1757661907/68c3cad333002s5l.html 原文作者:淘长源 转载注明以上信息 这是 MySQL 5.6 全局 ...
- Qt中事件处理的方法(三种处理方法,四种覆盖event函数,notify函数,event过滤,事件处理器。然后继续传递给父窗口。可观察QWidget::event的源码,它是虚拟保护函数,可改写)
一.Qt中事件处理的方式 1.事件处理模式一 首先是事件源产生事件,最后是事件处理器对这些事件进行处理.然而也许大家会问, Qt中有这么多类的事件,我们怎么样比较简便的处理每个事件呢?设想,如果是 ...
- 把所有的QT的类都过一遍脑子
http://doc.qt.io/qt-5/classes.html 这样就明白QT提供的全部功能了,避免重复造轮子,或者给自己开发带来麻烦-
- WPF 利用子线程弹出子窗体的研究
一般来说子线程都是用来处理数据的,主窗体用来实现展现,但是有些时候我们希望子窗体实现等待效果,遮挡主窗体并使主窗体逻辑正常进行,这个业务需求虽然不多,但是正好我们用到了,于是我打算把研究成果写在这了. ...
- Axure快捷键大全
基本快捷键: 打开:Ctrl + O 新建:Ctrl + N 保存:Ctrl + S 退出:Alt + F4 打印:Ctrl + P 查找:Ctrl + F 替换:Ctrl + H 复制:Ctrl + ...
- 开源欣赏wordpress之post.php
switch($action) { case 'postajaxpost': case 'post': case 'post-quickpress-publish': case 'post-quick ...
- LeeCode-Contains Duplicate
Given an array of integers, find if the array contains any duplicates. Your function should return t ...
- printf "%.*s" 分类: 小细节 2015-07-04 14:36 2人阅读 评论(0) 收藏
ref : http://www.cnblogs.com/yuaqua/archive/2011/10/21/2219856.html 小数点.后"*"表示输出位数,具体的数据来自 ...
- Hibernate框架(一)——总体介绍
作为SSH三大框架之一的Hibernate,是用来把程序的Dao层和数据库打交道用的,它封装了JDBC的步骤,是我们对数据库的操作更加简单,更加快捷.利用Hibernate框架我们就可以不再编写重复的 ...
- leetcode_question_73 Set Matrix Zeroes
Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow ...