mirror of
https://github.com/cloudpanel-io/cloudpanel-ce.git
synced 2026-04-05 20:31:58 +02:00
Nginx (client_max_body_size) Error 413 – Request Entity Too Large. #214
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @peixotorms on 7/8/2024
CloudPanel version(s) affected
2.4.2
Description
Just a quick note, but there is an issue on Nginx related to the file uploads.
client_max_body_size on nginx, needs to match with the php upload settings, else when we upload a larger file, it will trigger an HTTP error 413 – Request Entity Too Large.
How to reproduce
Install a WordPress site.
Adjust the PHP Settings on the GUI to use 128 MB or more.
Try to upload a PDF file with more than 64 Mb via the media upload on wp-admin.
It triggers a 413 error: https://share.raisercdn.com/raul/DEpIvOYe37.png
Possible Solution
Always match the Nginx client_max_body_size option on the vhost config location block for PHP, to match the PHP setting,
ie:
client_max_body_size 128M;Note that it needs it both in the initial http request and also in the reverse proxy.
Additional Context
No response