Skip to content

Raise WordPress upload limits: nginx body-size + PHP-FPM per-directory overrides#33

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/increase-upload-size-limits
Draft

Raise WordPress upload limits: nginx body-size + PHP-FPM per-directory overrides#33
Copilot wants to merge 1 commit into
mainfrom
copilot/increase-upload-size-limits

Conversation

Copilot AI commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Uploading large plugins (e.g. Gutenberg at ~35 MB) returned 413 Request Entity Too Large from nginx because /wp-admin/update.php inherited the global 10m default. PHP-FPM's upload_max_filesize defaulted to 2M, silently blocking media uploads that nginx would otherwise pass.

nginx (nginx/snippets/spx-upload-limits.conf)

Per-route client_max_body_size overrides, included by the HTTPS vhost:

Route Limit
/wp-admin/update.php 64m — plugin/theme ZIPs
/wp-admin/async-upload.php 100m — media library uploader
/wp-json/wp/v2/media 100m — REST API media endpoint

All values stay at or below Cloudflare's 100 MB per-request cap. Global default remains 10m.

PHP-FPM (var/www/html/.user.ini) — new file

PHP-FPM scans .user.ini from the document root for every request. upload_max_filesize / post_max_size are PHP_INI_PERDIR and cannot be set via ini_set() at runtime.

upload_max_filesize = 100M
post_max_size       = 105M   ; 5M headroom for multipart overhead

Direct web access is blocked by the existing <Files "\.(env|ini|...)$"> Require all denied rule in apache/conf-available/common-settings.conf.

Copilot AI requested review from Copilot and removed request for Copilot June 13, 2026 21:33
Copilot AI changed the title Raise nginx upload body-size limits for WordPress plugins and media Raise WordPress upload limits: nginx body-size + PHP-FPM per-directory overrides Jun 13, 2026
Copilot AI requested a review from MaximillianGroup June 13, 2026 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants