利用Nginx的Upload模块实现无限制大文件上传

利用Nginx的Upload模块实现无限制大文件上传

作者:Larry 时间:2012-02-15 分类:服务器 评论:0条 浏览:2822

server
{
listen 80;
server_name 1.server.xxx;
index index.html index.htm index.php;
root /web/vhosts/1.server.xxx/www;

location = /upload.php {
client_body_timeout 9999s; //最大允许的上传时间
client_max_body_size 300m; //最大上传大小
upload_pass @upload;
upload_store /web/vhosts/1.server.xxx/protected/runtime/files-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_cleanup 400-599;

upload_pass_args on;
}

location @upload {
fastcgi_next_upstream error timeout invalid_header http_500 http_503;
fastcgi_pass backend;
fastcgi_index index.php;
include fcgi.conf;
}

location ~ .*\.php?$
{
fastcgi_next_upstream error timeout invalid_header http_500 http_503;
fastcgi_pass backend;
fastcgi_index index.php;
include fcgi.conf;
}

location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}

location ~ .*\.(js|css)?$
{
expires 12h;
}
}

原创文章,转载请注明: 转载自www.webmaster.me

本文链接地址: 利用Nginx的Upload模块实现无限制大文件上传

标签:

相关推荐
更多

发表评论

电子邮件地址不会被公开。 必填项已用*标注

*

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据