【问题标题】:Nginx - Invalid number of arguments in client_max_body_sizeNginx - client_max_body_size 中的参数数量无效
【发布时间】:2016-05-01 22:51:45
【问题描述】:

我正在尝试在我的 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;
        }
}

我收到错误:/etc/nginx/sites-enabled/****.com 中的“client_max_body_size”指令中的参数数量无效

我的配置有什么问题?

【问题讨论】:

  • 你忘记了分号。

标签: nginx


【解决方案1】:

您忘记用分号结束该行。必须是

client_max_body_size 32m;

【讨论】:

    猜你喜欢
    • 2017-02-19
    • 2019-01-06
    • 1970-01-01
    • 2011-01-04
    • 1970-01-01
    • 2014-01-16
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多