nginx 413 Entity Too Large

 

* /usr/local/nginx/conf/nginx.conf

client_max_body_size 512m;

nginx 413 Entity Too Large_第1张图片

 

$ sudo /usr/local/nginx/sbin/nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
$ sudo /usr/local/nginx/sbin/nginx -s reload

 

*/usr/local/php/etc/php.ini


    674:post_max_size = 512M
    828:upload_max_filesize = 512M

 

 sudo /etc/init.d/php-fpm restart

 

创建php文件测试php.ini已经生效

cat limit.php

error_reporting(E_ALL);
ini_set("display_errors", 1);

$c = ini_get_all();
echo '

';
printf('post_max_size => ');
print_r($c['post_max_size']);
printf('upload_max_filesize => ');
print_r($c['upload_max_filesize']);
 

通过浏览器访问limit.php

 

post_max_size => Array
(
    [global_value] => 2M
    [local_value] => 2M
    [access] => 6
)
upload_max_filesize => Array
(
    [global_value] => 2M
    [local_value] => 2M
    [access] => 6
)

你可能感兴趣的:(web,nginx)