当前位置: 移动技术网 > 科技>操作系统>Linux > nginx 修改文件上传大小限制

nginx 修改文件上传大小限制

2019年11月25日  | 移动技术网科技  | 我要评论

修改nginx的配置文件,添加client_max_body_size 字段

注:client_max_body_size 必须要放在server下的server_name下,而不是放在location字段下面

 

server {
    listen       80;
    server_name  www.abc.com;

    add_header access-control-allow-origin *;
    add_header access-control-allow-credentials true;
    add_header access-control-allow-headers *;
    add_header access-control-allow-methods get,post,options;
	
    client_max_body_size 10m;

    location / {
        proxy_set_header   host $host;
        proxy_set_header   x-real-ip $remote_addr;
        proxy_set_header   x-request-id $global_request_id;
        proxy_set_header   x-forwarded-proto $scheme;
        proxy_set_header   x-forwarded-for $proxy_add_x_forwarded_for;
        proxy_ignore_headers x-accel-expires expires cache-control set-cookie;
        proxy_pass http://192.168.1.1:8080;
    }
}

 

  

 

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网