Nginx: how to fix error 413 Request Entity Too Large


How to fix error 413 Request Entity Too Large?

413 Request Entity Too Large

Configuration for Nginx:

Edit file /etc/nginx/nginx.conf add line

client_max_body_size 120m;

to http or server or location context.

You can change 120m to your own value like 2m …

fix how to fix error 413 Request Entity Too Large

Restart Nginx service

You can Configuration for PHP

Edit /etc/php.ini

You can change some values:

; Maximum size of POST data that PHP will accept.
; Its value may be 0 to disable the limit. It is ignored if POST data reading
; is disabled through enable_post_data_reading.
; http://php.net/post-max-size
post_max_size = 8M

; Maximum amount of memory a script may consume (128MB)
; http://php.net/memory-limit
memory_limit = 128M

; Maximum allowed size for uploaded files.
; http://php.net/upload-max-filesize
upload_max_filesize = 2M

Restart PHP-fpm service

Related
How to fix error: “413 Request Entity Too Large” when upload files
ExpressJS: How to fix error: 413 (Payload Too Large)

2 Comments

Leave a Reply