码迷,mamicode.com
首页 > Web开发 > 详细

限制上传文件的大小

时间:2017-05-31 16:39:16      阅读:224      评论:0      收藏:0      [点我收藏+]

标签:首部   content   epo   epoll   affinity   class   time   ror   live   

client_max_body_size 用于设置最大的允许客户端请求主体的大小,在请求首部中有 "Content-Length" ,如果超过了此配置项,客户端会收到 413 错误,即请求的条目过大

worker_processes  2;
worker_cpu_affinity  01 10;
user  nginx nginx;
error_log  logs/error.log  error;

events {
    use  epoll;
    worker_connections  20480;
}

http {
    include       mime.types;
    server_names_hash_bucket_size  512;     
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;
    server_tokens off;
client_max_body_size 8m; # 设置客户端最大的请求主体大小为8M include vhosts/*.conf; }

 

 

 

 

    

限制上传文件的大小

标签:首部   content   epo   epoll   affinity   class   time   ror   live   

原文地址:http://www.cnblogs.com/pzk7788/p/6924536.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!