Can't upload files to wordpress

Bug #1491995 reported by Nate Finch on 2015-09-03
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
wordpress (Juju Charms Collection)
Undecided
Unassigned

Bug Description

When you create a post or customize your site's appearance, you have the opportunity to upload files (i.e. pictures etc), which brings you to the "insert media" page.... uploads using this page apparently always fail with "http error". It appears to be an nginx configuration problem.

Note, I'm using just the default settings for wordpress (tuning=single etc) and mysql. This is easily reproducible with local provider (but is not specific to local provider).

Nate Finch (natefinch) wrote :

Appears to be an nginx configuration problem:

/var/log/nginx$ more error.log
2015/09/03 14:24:00 [error] 31196#0: *161 client intended to send too large body: 1326272 bytes, client: 10.0.3.1, server: _, request: "POST /wp-admin/async
-upload.php HTTP/1.1", host: "10.0.3.202", referrer: "http://10.0.3.202/wp-admin/customize.php?return=%2Fwp-admin%2F"
2015/09/03 14:41:49 [error] 31196#0: *314 client intended to send too large body: 1326367 bytes, client: 10.0.3.1, server: _, request: "POST /wp-admin/async
-upload.php HTTP/1.1", host: "10.0.3.202", referrer: "http://10.0.3.202/wp-admin/post-new.php"

Note, I'm uploading a file that is 1.3MB picture, and wordpress is defaulted to supporting 2MB... but evidently nginx's configuration is different.

Nate Finch (natefinch) on 2015-09-03
description: updated
Johan Ehnberg (johan-ehnberg) wrote :

I am seeing this as well. The cut-off seems to be around 1M. It happens despite the following settings:
/etc/nginx/nginx.conf:
client_max_body_size 500M;

/etc/php5/fpm/php.ini:
upload_max_filesize = 16M
post_max_size = 8M

Richard Harding (rharding) wrote :

I've changed the nginx conf, which was set to 512k out of the default deploy, restarted nginx, and been able to upload a 1.8mb file.

    sudo vim /etc/nginx/nginx.conf

# change client_max_body_size 2M;

    sudo service nginx restart

and the upload worked.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers