I installed nginx 1.7.12 + hhvm 3.7.0 + wordpress 4.2.2 on digital ocean droplet.

I am trying to upload a theme that is 17 mb. While uploading, after exactly 30 seconds the upload restarts itself 3-4 times and than I get an error page.

All the settings are default, I even tryed to put this in php.ini (hhvm):

max_execution_time = 300
max_input_time = 60
memory_limit = 128M
post_max_size = 50M
upload_max_filesize = 50M

But nothing changed.

Any thoughts?


When the client informs it that it's going to send a body larger than the client_max_body_size nginx will send a 413 response and closing the connection. Change your config by adding the client_max_body_size 50m or any number bigger to allow larger uploads. From the docs:

Syntax:     client_max_body_size size;
Default:    client_max_body_size 1m;
Context:    http, server, location

Nginx Docs

  • You should try to restart nginx after the update of the php.ini
  • You should also make sure that you have modified the php.ini of the web service a not the one for the CLI of php.
  • I fixed it by putting this in nginx.conf client_max_body_size 200M; – Speedwheel Jun 14 '15 at 6:19

This can be related to a number of things. From the NGINX configuration (which typically results in an http error) to wrong user/group permissions which can result in a variety of errors.

The main thing you should check for, is a correct configuration of www-data user and group permissions. Which is related to the NGINX configuration.

After that, you'll want to look at the configurations of:

  • NGINX virtual host
  • NGINX server block
  • HHVM php.ini
  • HHVM server.ini

The solution lies somewhere inside the above. If you can provide some more information it will be easier to help you narrow down the issue.

  • I fixed it by putting this in nginx.conf client_max_body_size 200M; – Speedwheel Jun 14 '15 at 6:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.