- 浏览: 1446438 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
费劲周折,一晚上终于搞定了,nginx版本1.38
--------------
---------------
测试php是否好使
cat index.php
nginx上传进度条
参考链接:
http://wiki.nginx.org/HttpUploadProgressModule
http://www.grid.net.ru/nginx/upload.en.html
nginx基础的包:
yum install openssl-devel zlib-devel prce-devel
如果
/usr/local/app/nginx_upload_module-2.2.0/ngx_http_upload_module.c: 在函数‘ngx_http_upload_merge_ranges’中:
/usr/local/app/nginx_upload_module-2.2.0/ngx_http_upload_module.c:1682:22: 错误:变量‘result’被设定但未被使用 [-Werror=unused-but-set-variable]
出现这个错误
就把Makefile文件里的 -Werror去掉
在fedora17中遇到
在redhat6.3中没有
配置文件需要注意
注意,官方的配置文件不对
需要加个这个
php的支持:
yum install spawn-fcgi
yum install php
yum install php-cgi
test.php
启动fast-cgi支持php
配置文件问:
nginx.conf
简单例子测试是否可以上传
注意/tmp权限
mkdir /tmp/1 2 3 ...
chmod -R 777 /tmp
然后用jquery的插件的版本:
附件中有下好的安装包,不保函yum的
--------------
---------------
测试php是否好使
cat index.php
<?php phpinfo(); ?>
nginx上传进度条
4部分 1.php的支持,自带的,就是建立一个fast-cgi跑php,提供一个test.php显示最终结果 2.nginx_upload_module 上传插件 http://www.grid.net.ru/nginx/download/nginx_upload_module-2.2.0.tar.gz 3.nginx_upload_progress_module,上传进度条插件 akostrikov-nginx-upload-progress-module-v0.8.2-1-g3d8e105.zip http://wiki.nginx.org/HttpUploadProgressModule 下载 https://nodeload.github.com/akostrikov/nginx-upload-progress-module/zipball/master 4.https://github.com/drogus/jquery-upload-progress ,显示进度条的jquery插件
参考链接:
http://wiki.nginx.org/HttpUploadProgressModule
http://www.grid.net.ru/nginx/upload.en.html
nginx基础的包:
yum install openssl-devel zlib-devel prce-devel
./configure --prefix=/usr/local/nginx --add-module=/usr/local/app/nginx_upload_module-2.2.0 --add-module=/usr/local/app/masterzen-nginx-upload-progress-module-a788dea --with-debug
如果
/usr/local/app/nginx_upload_module-2.2.0/ngx_http_upload_module.c: 在函数‘ngx_http_upload_merge_ranges’中:
/usr/local/app/nginx_upload_module-2.2.0/ngx_http_upload_module.c:1682:22: 错误:变量‘result’被设定但未被使用 [-Werror=unused-but-set-variable]
出现这个错误
就把Makefile文件里的 -Werror去掉
在fedora17中遇到
在redhat6.3中没有
配置文件需要注意
注意,官方的配置文件不对
需要加个这个
location ~ (.*)/x-progress-id:(\w*) { rewrite ^(.*)/x-progress-id:(\w*) $1?X-Progress-ID=$2; }
php的支持:
yum install spawn-fcgi
yum install php
yum install php-cgi
test.php
[root@haoning html]# cat test.php <?php print_r($_POST); ?>
启动fast-cgi支持php
groupadd www-data useradd www-data -g www-data /usr/bin/spawn-fcgi -a 127.0.0.1 -p 9001 -u www-data -g www-data -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid
配置文件问:
nginx.conf
[root@fedora17 conf]# cat nginx.conf worker_processes 1; events { worker_connections 1024; } http { autoindex on; autoindex_exact_size off; autoindex_localtime on; default_type application/octet-stream; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 10; gzip on; gzip_min_length 1k; gzip_buffers 4 8k; gzip_http_version 1.1; gzip_comp_level 3; gzip_types text/css text/xml text/plain application/x-javascript application/xml application/pdf application/rtf application/x-perl application/x-tcl application/msword application/vnd.ms-excel application/vnd.ms-powerpoint application/vnd.wap.xhtml+xml image/x-ms-bmp; gzip_vary on; output_buffers 4 32k; upload_progress_json_output; upload_progress proxied 1m; server { listen 80; server_name 192.168.76.138; charset utf-8,gb2312; client_max_body_size 2000m; location /upload { upload_pass @test; upload_store /tmp 1; upload_store_access user:r; upload_set_form_field "${upload_field_name}_name" $upload_file_name; upload_set_form_field "${upload_field_name}_content_type" $upload_content_type; 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}_size" $upload_file_size; upload_pass_form_field "^submit$|^description$"; track_uploads proxied 30s; } location @test { rewrite ^(.*)$ /test.php last; } location / { proxy_set_header Host $http_host; root html; index index.html index.htm index.php; } location ~ (.*)/x-progress-id:(\w*) { rewrite ^(.*)/x-progress-id:(\w*) $1?X-Progress-ID=$2; } location ^~ /progress { report_uploads proxied; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9001; fastcgi_index index.php; set $path_info "/"; set $real_script_name $fastcgi_script_name; if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$") { set $real_script_name $1; set $path_info $2; } } location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$ { root html; access_log off; expires 30d; } location ~ .*\.(js|css|ico)?$ { root html; access_log off; expires 1h; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } fastcgi_param SCRIPT_FILENAME $document_root$real_script_name; fastcgi_param script_name $real_script_name; fastcgi_param path_info $path_info; include /usr/local/nginx/conf/fastcgi_params; } }
简单例子测试是否可以上传
<html> <head> <title>Test upload</title> </head> <body> <h2>Select files to upload</h2> <form enctype="multipart/form-data" action="/upload" method="post"> <input type="file" name="file1"><br> <input type="file" name="file2"><br> <input type="file" name="file3"><br> <input type="file" name="file4"><br> <input type="file" name="file5"><br> <input type="file" name="file6"><br> <input type="submit" name="submit" value="Upload"> <input type="hidden" name="test" value="value"> </form> </body> </html>
注意/tmp权限
mkdir /tmp/1 2 3 ...
chmod -R 777 /tmp
然后用jquery的插件的版本:
[root@haoning example]# cat index.html <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>ajaxFileUpload</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="../lib/jquery.js"></script> <script src="../jquery.uploadProgress.js"></script> <script type="text/javascript"> $(function() { $('form').uploadProgress({ /* scripts locations for safari */ jqueryPath: "../lib/jquery.js", uploadProgressPath: "../jquery.uploadProgress.js", start:function(){}, uploading: function(upload) {$('#percents').html(upload.percents+'%');}, interval: 2000 }); }); </script> <style type="text/css"> .bar { width: 300px; } #progress { background: #eee; border: 1px solid #222; margin-top: 20px; } #progressbar { width: 0px; height: 24px; background: #333; } </style> </head> <body> <form id="upload" enctype="multipart/form-data" action="/upload" method="post"><!--注意这里改了--> <input name="file" type="file"/> <input type="submit" value="Upload"/> </form> <div id="uploading"> <div id="progress" class="bar"> <div id="progressbar"> </div> </div> </div> <div id="percents"></div> </body> </html>
附件中有下好的安装包,不保函yum的
发表评论
-
ios的safari使用自制ca证书测试webrtc
2018-08-20 13:31 2339这个需要注意 https://stackoverflow.c ... -
nginx push_upstream模块的websocket
2018-05-04 23:27 1158参考 https://www.rails365.net/art ... -
openresty聊天室的helloworld
2018-04-22 19:25 727openresty的websocket + redis的sub ... -
openresty websocket
2018-04-18 17:08 1420mac安装openresty brew install o ... -
nginx模块开发(三)upstream模块
2017-08-20 23:48 797使用nginx-1.13.4版本 三个文件ngx_http_ ... -
nginx模块开发(二) 使用gdb-dashboard调试
2017-08-11 18:47 1924gdb-dashboard或者 gdbgui 或者gdb自带 ... -
nginx模块开发(一)
2017-07-29 22:44 528决定重新整理nginx模块开发 helloworld con ... -
nginx带进度条的上传超大文件
2016-12-12 18:40 382611年写的 http://haoningabc.iteye.c ... -
nginx rewrite替代apache rewrite
2016-10-18 20:30 788清理chrome的缓存 chrome://appcache-i ... -
ffmpeg+nginx 的直播(2,直播摄像头和麦克风)
2016-05-28 20:21 4259假设我的服务器是centos7 192.168.139.117 ... -
ffmpeg+nginx 的直播(1,直播播放的视频文件)
2016-05-26 17:11 652264位操作系统centos7 ############ 1.一 ... -
nginx执行流程
2014-04-15 18:35 1042目标:打印nginx执行之后的流程方法 my_debug.c ... -
graphviz绘制nginx函数调用图
2014-04-14 18:43 1427以下是c的版本 c++代码去 http://www.cnblo ... -
nginx的远程调用模块
2014-03-24 14:31 2736在tx工作的时候,自己的虚拟机总是连接不上,公司封了ssh端口 ... -
通过nginx远程执行shell
2014-03-03 10:26 4988saltstack远程执行shell,远程管理等返回json已 ... -
nginx的upstream模块
2014-01-17 17:37 3159参考http://nginx.weebly.com/31034 ... -
nginx调试日志的几种方法
2013-10-17 22:54 23245最简单的方式就是 fprintf(stderr, &qu ... -
nginx HttpSecureLinkModule 过期token验证模块
2012-11-07 02:15 6052用途,确认一个链接比如下载pdf,在一定有效期内有用 可以加 ... -
ubuntu装openrestry
2012-03-01 00:16 1286apt-get install make apt-get in ... -
udp的socket的helloworld
2011-12-07 00:56 1066来自百度 [root@red54apple test]# ...
相关推荐
NULL 博文链接:https://yhq1212.iteye.com/blog/2235726
nginx的文件上传获取实时进度条模块
3) 修改服务器端可上传文件大小的限制 在文件 usr local nginx conf nginx conf中修改client max body size 毕竟是第一次用 不是很熟悉 希望有人发现问题可以交流一下">这是根据uploadify3 2结合struts2搭建的...
下面通过文字说明给大家详解Nginx上传文件全部缓存解决方案。 因为应用服务器(Jetty)里面实现了上传时写了进度条。经过缓存。就没法读取到进度了。此外,在Nginx处缓存文件,也降低了传输效率。 nginx采用1.5.6。 ...
1. 文件无任何依赖可以编译成linux,window,arm平台都能使用 2. 单文件根据执行参数可以既可以当服务端用也可以当客户端用 3. 支持上传模式和下载...11. 基于websocket协议非常容易用nginx反向代理容易实现7层负载均衡
p 8089切换端口,且切换后自行用 Nginx 反向代理的形式配置直接访问即可进入安装引导界面六、注意事项当你使用第三方上传时(七牛云),后台界面上传成功的进度条不代表真实的上传进度。例如:当你上传大文件时,也许你...
各个子系统前台thymeleaf模板,前端资源模块,使用nginx代理,实现动静分离。 > zheng-upms 本系统是基于RBAC授权和基于用户授权的细粒度权限控制通用平台,并提供单点登录、会话管理和日志管理。接入的系统可自由...
根据您拥有多少文件可能要花费几分钟或几小时,有一个进度条可以使您有所了解。这是什么? Chibisafe是一种用node编写的文件上传器服务,旨在易于使用和设置。 它主要用于图像和视频,但是可以接受您扔给它的任何...
- 全平台兼容性:Win Linux Mac (Apache、Nginx、IIS) #### 2.使用场景: - 取代FTP,服务端、客户端软件等复杂的安装配置。kod可以一键安装随处使用. - 你可以用它来管理你的服务器(备份,在线解压缩,版本发布......
08 FTP之进度条 09 FTP之cd切换 11 FTP之创建文件夹及MD5校验思路 第33章 01 操作系统历史 02 进程的概念 03 线程的概念 04 线程的调用以及join方法 05 setDaemon方法和继承式调用.baiduyun.downloading 05 ...