Nginx - client_max_body_size 中的参数数量无效 [英] Nginx - Invalid number of arguments in client_max_body_size

查看:206
本文介绍了Nginx - client_max_body_size 中的参数数量无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 nginx 配置文件中设置 client_max_body_size.

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

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

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

我的配置有什么问题?

推荐答案

您忘记用分号终止该行.必须

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

client_max_body_size 32m;

这篇关于Nginx - client_max_body_size 中的参数数量无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆