When I try to upload an image, I get the following error: HTTP error.

I know this problem has been solved hundred times but I can't find the right answer form my configuration.

In the php.ini, I have the following:

upload_max_filesize = 50M
max_file_uploads = 20
post_max_size = 50M

And in my wp-config.php, I added:

define('WP_MEMORY_LIMIT', '120MB');

I am using nginx, so every answers using .htaccess are not useful for my case. How can I solve my problem ?

1 Answer 1


I figured out how to fix my problem.

In my nginx config file (/etc/nginx/nginx.conf) I added client_max_body_size 100m; at the end of the #Basic Settings in the http {} section.

I hope this answer will help some of you and please tell me if there is any better solution to this problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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