- 浏览: 1448309 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (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调试内核
11年写的
http://haoningabc.iteye.com/blog/1711534
重新整理下
准备----------------------------------------------
nginx-1.8.1.tar.gz 能过,
1.10不行,会有openssl md5之类的错误
上传
https://github.com/vkholodkov/nginx-upload-module/tree/2.2
nginx-upload-module-2.2.zip
上传进度条
https://www.nginx.com/resources/wiki/modules/upload_progress/
使用v0.8.4 的版本
masterzen-nginx-upload-progress-module-v0.8.4-0-g82b35fc.tar.gz
上传进度条客户端:
https://github.com/drogus/jquery-upload-progress
跑php的fcgi
spawn-fcgi-1.6.3.tar.bz2
yum install openssl-devel zlib-devel prce-devel -y
这些 nginx需要用到的
yum install php php-devel -y
安装-----------------------------------------
安装spawn-fcgi
启动脚本
runcgi.sh
安装nginx
编译nginx
nginx配置文件
客户端
jquery-upload-progress-master.zip
解压到
/usr/local/nginx/html/
cd /usr/local/nginx/html/jquery-upload-progress-master/example
vim index.html
改成
因为nginx配置的/upload
加一个请求返回的php返回值
test.php
启动
cd /tmp
watch -n 1 'ls -lh'
查看上传的文件
chmod -R 777 /tmp
浏览器访问
http://192.168.139.122/jquery-upload-progress-master/example/
效果
http://haoningabc.iteye.com/blog/1711534
重新整理下
准备----------------------------------------------
nginx-1.8.1.tar.gz 能过,
1.10不行,会有openssl md5之类的错误
上传
https://github.com/vkholodkov/nginx-upload-module/tree/2.2
nginx-upload-module-2.2.zip
上传进度条
https://www.nginx.com/resources/wiki/modules/upload_progress/
使用v0.8.4 的版本
masterzen-nginx-upload-progress-module-v0.8.4-0-g82b35fc.tar.gz
上传进度条客户端:
https://github.com/drogus/jquery-upload-progress
跑php的fcgi
spawn-fcgi-1.6.3.tar.bz2
yum install openssl-devel zlib-devel prce-devel -y
这些 nginx需要用到的
yum install php php-devel -y
安装-----------------------------------------
安装spawn-fcgi
tar xvf spawn-fcgi-1.6.3.tar.bz2 ./configure --prefix=/usr/local/spawn make make install
启动脚本
runcgi.sh
# !/bin/sh export PHP_FCGI_MAX_REQUESTS=0 /usr/local/spawn/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u haoning -g haoning -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid
安装nginx
编译nginx
./configure --prefix=/usr/local/nginx --add-module=/opt/masterzen-nginx-upload-progress-module-82b35fc --add-module=/opt/nginx-upload-module-2.2 make make install
nginx配置文件
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.139.114; charset utf-8,gb2312; client_max_body_size 12000m; location /upload { upload_pass @test; #upload_store /tmp 1; upload_store /tmp; 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:9000; 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; } }
客户端
jquery-upload-progress-master.zip
解压到
/usr/local/nginx/html/
cd /usr/local/nginx/html/jquery-upload-progress-master/example
vim index.html
<body> <form id="upload" enctype="multipart/form-data" action="index.html" method="post"> <input name="file" type="file"/> <input type="submit" value="Upload"/> </form>
改成
<body> <form id="upload" enctype="multipart/form-data" action="/upload" method="post"> <input name="file" type="file"/> <input type="submit" value="Upload"/> </form>
因为nginx配置的/upload
加一个请求返回的php返回值
test.php
<?php print_r($_POST); ?>
启动
export PHP_FCGI_MAX_REQUESTS=0 /usr/local/spawn/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u haoning -g haoning -f /usr/bin/php-cgi -P /var/run/fastcgi-php.pid /usr/local/nginx/sbin/nginx
cd /tmp
watch -n 1 'ls -lh'
查看上传的文件
chmod -R 777 /tmp
浏览器访问
http://192.168.139.122/jquery-upload-progress-master/example/
效果
发表评论
-
ios的safari使用自制ca证书测试webrtc
2018-08-20 13:31 2342这个需要注意 https://stackoverflow.c ... -
nginx push_upstream模块的websocket
2018-05-04 23:27 1160参考 https://www.rails365.net/art ... -
openresty聊天室的helloworld
2018-04-22 19:25 728openresty的websocket + redis的sub ... -
openresty websocket
2018-04-18 17:08 1422mac安装openresty brew install o ... -
nginx模块开发(三)upstream模块
2017-08-20 23:48 799使用nginx-1.13.4版本 三个文件ngx_http_ ... -
nginx模块开发(二) 使用gdb-dashboard调试
2017-08-11 18:47 1927gdb-dashboard或者 gdbgui 或者gdb自带 ... -
nginx模块开发(一)
2017-07-29 22:44 528决定重新整理nginx模块开发 helloworld con ... -
nginx rewrite替代apache rewrite
2016-10-18 20:30 789清理chrome的缓存 chrome://appcache-i ... -
ffmpeg+nginx 的直播(2,直播摄像头和麦克风)
2016-05-28 20:21 4264假设我的服务器是centos7 192.168.139.117 ... -
ffmpeg+nginx 的直播(1,直播播放的视频文件)
2016-05-26 17:11 652664位操作系统centos7 ############ 1.一 ... -
nginx执行流程
2014-04-15 18:35 1044目标:打印nginx执行之后的流程方法 my_debug.c ... -
graphviz绘制nginx函数调用图
2014-04-14 18:43 1431以下是c的版本 c++代码去 http://www.cnblo ... -
nginx的远程调用模块
2014-03-24 14:31 2736在tx工作的时候,自己的虚拟机总是连接不上,公司封了ssh端口 ... -
通过nginx远程执行shell
2014-03-03 10:26 4998saltstack远程执行shell,远程管理等返回json已 ... -
nginx的upstream模块
2014-01-17 17:37 3162参考http://nginx.weebly.com/31034 ... -
nginx调试日志的几种方法
2013-10-17 22:54 23251最简单的方式就是 fprintf(stderr, &qu ... -
nginx HttpSecureLinkModule 过期token验证模块
2012-11-07 02:15 6054用途,确认一个链接比如下载pdf,在一定有效期内有用 可以加 ... -
nginx 上传进度条
2012-11-01 16:24 7555费劲周折,一晚上终于搞定了,nginx版本1.38 ----- ... -
ubuntu装openrestry
2012-03-01 00:16 1289apt-get install make apt-get in ... -
udp的socket的helloworld
2011-12-07 00:56 1070来自百度 [root@red54apple test]# ...
相关推荐
NULL 博文链接:https://yhq1212.iteye.com/blog/2235726
3) 修改服务器端可上传文件大小的限制 在文件 usr local nginx conf nginx conf中修改client max body size 毕竟是第一次用 不是很熟悉 希望有人发现问题可以交流一下">这是根据uploadify3 2结合struts2搭建的...
nginx的文件上传获取实时进度条模块
下面通过文字说明给大家详解Nginx上传文件全部缓存解决方案。 因为应用服务器(Jetty)里面实现了上传时写了进度条。经过缓存。就没法读取到进度了。此外,在Nginx处缓存文件,也降低了传输效率。 nginx采用1.5.6。 ...
1. 文件无任何依赖可以编译成linux,window,arm平台都能使用 2. 单文件根据执行参数可以既可以当服务端用也可以当...10. 命令行窗口带进度条显示 11. 基于websocket协议非常容易用nginx反向代理容易实现7层负载均衡
p 8089切换端口,且切换后自行用 Nginx 反向代理的形式配置直接访问即可进入安装引导界面六、注意事项当你使用第三方上传时(七牛云),后台界面上传成功的进度条不代表真实的上传进度。例如:当你上传大文件时,也许你...
[关于上传问题] 程序没有做任何限制,如果需要上传大文件,则修改 php.ini:`upload_max_filesize = 1000M post_max_size = 1000M` [关于解压缩问题] 程序不做任何限制,如若失败请设置php内存限制。memory_limit ...
根据您拥有多少文件可能要花费几分钟或几小时,有一个进度条可以使您有所了解。这是什么? Chibisafe是一种用node编写的文件上传器服务,旨在易于使用和设置。 它主要用于图像和视频,但是可以接受您扔给它的任何...
各个子系统前台thymeleaf模板,前端资源模块,使用nginx代理,实现动静分离。 > zheng-upms 本系统是基于RBAC授权和基于用户授权的细粒度权限控制通用平台,并提供单点登录、会话管理和日志管理。接入的系统可自由...
01 selctors实现文件上传与下载 02 html的介绍 03 html文档树的概念 04 meta标签以及一些基本标签 05 img标签和列表标签 06 form表单之input标签 07 通过form向server端发送数据 08 form表单之select标签 09 table...