NginX

413 Request Entity Too Large

NginxError: 413 Request Entity Too Large

occurs when you want to upload too large file.

 

On Centos 6.6 do the following:

# vim  vim /etc/nginx/nginx.conf

and under http {} add line

client_max_body_size 5M;


# service nginx restart

 

Also change php.ini

# vim /etc/php.ini

and modify lines:

;This sets the maximum amount of memory in bytes that a script is allowed to allocate
memory_limit = 128M
 
;The maximum size of an uploaded file.
upload_max_filesize = 5M
 
;Sets max size of post data allowed. This setting also affects file upload. To upload large files, this value must be larger than upload_max_filesize
post_max_size = 8M

 

# service php-fpm restart