Nginx - client_max_body_size中的参数数量无效

时间:2016-01-25 15:09:18

标签: nginx

我试图在我的nginx配置文件中设置client_max_body_size。

server {
    listen 80;
    server_name ****.com;
    root ****;

    client_max_body_size 32m

    location / {
                try_files $uri /app.php$is_args$args;
        }

        location ~ ^/(app_dev|config)\.php(/|$) {
        fastcgi_pass 127.0.0.1:9000;
               fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;

        fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;
    }

        location ~ ^/app\.php(/|$) {
                fastcgi_pass  127.0.0.1:9000;
        fastcgi_split_path_info ^(.+\.php)(/.*)$;
            include fastcgi_params;

        fastcgi_param  SCRIPT_FILENAME  $realpath_root$fastcgi_script_name;
            fastcgi_param DOCUMENT_ROOT $realpath_root;

        internal;
        }
}

我收到错误:" client_max_body_size"中的参数数量无效; / etc / nginx / sites-enabled / ****。com

中的指令

我的conf有什么问题?

1 个答案:

答案 0 :(得分:9)

您忘了用分号终止该行。必须是

client_max_body_size 32m;