2016-01-25 68 views
1

我試圖在我的nginx配置文件中設置client_max_body_size。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?

+0

您已經忘記了分號。 –

回答

7

你忘了用分號終止這一行。必須是

client_max_body_size 32m;