• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Resolved 413 Request Entity Too Large

geco68230

New Pleskian
Hi,

I'm running a system on wordpress that allows me to download large zip files (up to 780M).

Until now I was on ISPConfig and to allow this I used the following queries.

for custom php.ini settings :
Max_execution_time = 6000000;
Upload_max_filesize = 500M;
Post_max_size = 500M;
Memory_limit = 512M;

for Apache settings:
FCgidMaxRequestLen 900000000
Php_admin_value post_max_size 500M
Php_admin_value upload_max_filesize 500M
Timeout 60000


But that does not work on Plesk.
Currently I put this for PHP settings:
max_execution_time = 6000000;
upload_max_filesize = 780M;
post_max_size = 780M;
memory_limit = 512M;
max_input_vars = 10000
max_input_time = 4000

And that for Apache:
<IfModule mod_fcgid.c>
FcgidMaxRequestLen 1073741824
FcgidMaxRequestsPerProcess 100
FcgidProcessLifeTime 7200
</IfModule>


But that does not seem to be enough.
Here is the error that appears in the logs when I try to upload a file superior to 300M:
413 Request Entity Too Large
nginx, status=413, responseHeaders=Date: Tue, 06 Dec 2016 11:20:18 GMT Server: nginx Connection: close Content-Length: 594 Content-Type: text/html
[StateChanged] STOPPED
[UploadComplete]


Please could you tell me what i need to do ?
It seems to be a problem with Nginx...
 
Hi geco68230,

you could use the (custom/additional ) "nginxClientMaxBodySize" setting at your "/usr/local/psa/admin/conf/panel.ini" ( if this file isn't existent yet, then pls. copy the SAMPLE with the example commands over your command line ( as user "root" ): => "cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini" ). The STANDARD here would be "128m" ( 128 MB ), so you might use in your "panel.ini"
Code:
...
[webserver]
nginxClientMaxBodySize = 128m
...
followed by the command "plesk sbin httpdmng --reconfigure-all" and "service nginx restart". You have now the possibility to define a custom definition AT EACH (sub)domain :

Home > Subscriptions > (SUBDOMAIN.)YOUR-DOMAIN.COM > Apache & nginx Settings > ( textbox) Additional nginx directives

... with for example:
Code:
client_max_body_size 780m
( clicking on "OK" or "APPLY" at the bottom of the site will start the webserver - configuration - build - process for the (sub)domain and restart nginx. Other (sub)domains on your server will still use the standard "128 MB". )
 
Last edited by a moderator:
Invalid nginx configuration: nginx: [emerg] unexpected end of file, expecting ";" or "}" in /var/www/vhosts/system/vidwe.net/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
 
Hi yusuf,

Invalid nginx configuration: nginx: [emerg] unexpected end of file, expecting ";" or "}"
as you can see within your error message, you have a MISSING ";" or "}" at your additional configuration.

Nginx always expects a ";" at the end of a setting. ;)
 
i have this error
Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/zippyloads.com/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
 
okey the problem about duplicate is resolved

you said to add two lines to /usr/local/psa/admin/conf/panel.ini
...
[webserver]
nginxClientMaxBodySize = 128m
...
and that cause duplicate problem you should add this

...
[webserver]
nginxClientMaxBodySize =
...

without 128m value

thanks

 
Hi yusuf,

the suggestions at => #2 where valid at "Dec 6, 2016" for Plesk 12.5, tested and afterwards the thread has been marked as solved.

If you experience, that previous suggestions and resolutions at this forum might not suit your needs, it could be that you use a completely different Plesk version or/and ( in this special case! ) different Plesk webserver configuration templates, so that the suggestions and resolutions will conflict with your actual Plesk version used on your server right now.

Pls. consider to open a NEW thread in the future, if you experience issues/errors/problems with Plesk, as you might get suggestions from people willing to help you for YOUR actual operating system and the current used Plesk version(s), based on an actual investigation. ;)
 
I'm having the same issue with Plesk 18.0.61 Update 5 and setting the nginxClientMaxBodySize to 2000m didn't change anything. What could I do now?
 
In my case, I was using Plesk to host a PrivateBin instance. When uploading files, I noticed in the logs that it was failing with an error similar to this:
Code:
[client IP] ModSecurity: Request body no files data length is larger than the configured limit (1048576).. Deny with code (413) [hostname "website.com"] [uri "/"] [unique_id "asdlkawlwqerewrwe"]
After some research, I found that the issue was related to an Apache configuration combined with Imunify360, which was blocking these transactions even if ModSecurity was disabled at the domain level.

I solved it by adding the following configuration under "Additional Apache directives" in Plesk:

Code:
<IfModule mod_security2.c>
SecRequestBodyLimit 4294967296
SecRequestBodyNoFilesLimit 4294967296
</IfModule>


Additionally, I adjusted the "Maximum allowed size of the HTTP request body" (client_max_body_size) in the same section to 4G. After saving the changes, I restarted Apache (Ubuntu 22 server).
This completely fixed the problem.
 
Back
Top