• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

nginx: 413 Request Entity Too Large

Azurel

Silver Pleskian
Bug in nginx: 413 Request Entity Too Large

Plesk 11.5.30

I want upload with plupload a 1.53MB image and get back a error:

<html>
<head><title>413 Request Entity Too Large</title></head>
<body bgcolor="white">
<center><h1>413 Request Entity Too Large</h1></center>
<hr><center>nginx</center>
</body>
</html>

Google says that I must set

http {
# some directives

client_max_body_size 20M;

# some more directives
}

So I go to plesk "Web Server Settings for ..." and set for nginx input this line:
client_max_body_size 20M;

And get red colored error text:
Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/domain.com/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed

This domain have _not_ vhost_nginx.conf before. Its with this error message new created and empty.


What can I do?


EDIT: Email says
Template_Exception: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/domain.com/conf/vhost_nginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 68
code: 0

In /etc/nginx/nginx.conf the string "client_max_body_size" not exists. But in Include its present for "SERVER" as value "128m". But not for "HTTP". Is this a bug?

EDIT: Found Bugreport for plesk here: http://wiki.1awww.com/wiki/413_Request_Entity_Too_Large (german)
 
Last edited:
Please add into nginx configuration file:

client_max_body_size 0;

to /etc/nginx/nginx.conf and reload nginx proxy server:

# /etc/init.d/nginx reload

Or you can simply disable nginx proxy server.
 
Just chucking my two cents in on this issue. I tried the steps in the following kb article: http://kb.odin.com/en/122689

Unfortunatly that didn't work, and I was still unable to add the "client_max_body_size" to Additional nginx directives field for each domain.

In the end, as IgorG mentioned, the only option was to stop Reverse Proxy Server (nginx) in Plesk Services Management.

Once I did that, I could easily upload a 137MB file, without the fatal 413 error.

BUT, will the Reverse Proxy be re-started on a server reboot IgorG?
 
Back
Top