Nginx - Invalid number of arguments in client_max_body_size

。_饼干妹妹 提交于 2021-02-08 07:45:24

问题


I'm trying to set client_max_body_size in my nginx config file.

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;
        }
}

I'm getting error: invalid number of arguments in "client_max_body_size" directive in /etc/nginx/sites-enabled/****.com

Whats wrong with my conf?


回答1:


You forgot to terminate the line with semicolon. Has to be

client_max_body_size 32m;


来源:https://stackoverflow.com/questions/34995823/nginx-invalid-number-of-arguments-in-client-max-body-size

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!