Nginx之 entity too large

背景:

nginx上传文件报" entity too large",原因是上传文件的大小超过了“client_max_body_size”的值

解决:

1.找到对应的nginx配置文件,有些是对应应用的配置文件

2.修改client_max_body_size值:

server {
    listen       80;
    server_name  www.linkrmb.com;
    location / {
        proxy_pass http://xxxx/;
	proxy_set_header        Host    $http_host;
	proxy_set_header        X-Real-IP       $remote_addr;
	proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header   Cookie $http_cookie;   
	 client_max_body_size    1000m;
    }
}

3.重启:

sbin/nginx -s reload

相关推荐