WordPress HTTP Error with Nginx

While trying to upload a 4mb PDF file using the WordPress 2.7 media manager, I received a very unhelpful “HTTP Error” message. I found several references to mod_security being the problem, but that was for Apache setups. I finally stumbled on the true error by using the Browser uploader instead of the flash uploader. The real error message was 413 (Request entity too large). This lead me to the client_max_body_size directive of nginx. After adjusting this value to a larger value in my configuration file, my file uploaded successfully.

Hopefully this information comes in handy for a few people so that they don’t waste time on a wild goose chase with the Apache HTTP Error problem.

What exactly was the error?

The real error

The real problem.

7 comments… add one
  • Saniyusuf Aug 20, 2011 Link Reply

    i need help. i duno how to go about this bt hav same prpos

    • vlota Oct 29, 2011 Link Reply

      First, try asking your question in English, not ‘txt speak’. That way people won’t assume you’re a moron and ignore you.

  • anonymouscoward Sep 21, 2009 Link Reply

    Great stuff, just got this error on some website i moved to nginx (because apache couldn’t handle it!) and fixed it because of your post.

    thanks.

  • Sonny Gill Jun 17, 2009 Link Reply

    Thank You.
    I just ran into this error, and yours was the first page on google search. Saved me quite a bit of time 🙂

  • Nate B May 10, 2009 Link Reply

    Did you have to do anything out of the ordinary to get the Flash uploader working? I moved from Apache to Nginx and the Flash uploader won’t even open the browse box on the Nginx server. Files are exact copies between the two servers and the standard upload works on the Nginx server.

    • Jon Stacey May 10, 2009 Link Reply

      Nate B, I didn’t have to do anything special to get it working. I did set the client_max_body_size Nginx directive to allow larger file uploads, but I could still upload small files before increasing that limit.

    • Jon Stacey May 10, 2009 Link Reply

      Oh, I forgot to add that the Nginx access and error logs should have additional information if it’s a problem on the server side. Use tail -f on the logs and hit the upload page to see if anything crops up.

Leave a Comment

Time limit is exhausted. Please reload CAPTCHA.