只是为了研究nginx的文件上传功能,做了如下的一些功能测试。
1.下载 nginx_upload_module-2.2.0,解压放置目录 /home/ffair/upload
2.下载nginx 源码 1.5.2版本
3.安装 nginx
./configure --prefix=/home/ffair/install/ngx --add-module=/home/ffair/upload/nginx_upload_module-2.2.0
make
make install
4.修改nginx的配置文件如下
http {
include mime.types;
default_type application/octet-stream;
server {
listen 5000;
client_max_body_size 100m;
# Upload form should be submitted to this location
location /upload {
# Pass altered request body to this location
#upload_pass None;
upload_pass /test.php;
# Store files to this directory
# The directory is hashed, subdirectories 0 1 2 3 4 5 6 7 8 9 should exist
#设置文件上传的存储目录
u