• 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

Resolved client_max_body_size duplicate Problem still exists

Urmeli

New Pleskian
Hello Guys,

as mentioned in the Changelog from Update 12.0.18 the following Problem should have been resolved:
159. "Users could not adjust the nginx setting client_max_body_size parameter. They received an error message about duplicate directives. (PPP-7504)"
http://download1.parallels.com/Plesk/PP12/parallels-plesk-12.0-for-linux-change-log.html

I am running Plesk version 12.0.18 Update #61, last updated at Aug 26, 2015 10:33 AM on OS Ubuntu 14.04.2 LTS, but I have still the problem, that I get the error:
"Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/subdomain.de/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed"
when I try to add the client_max_body_size parameter to the "Additional nginx directives" in the PleskGUI.

Any Ideas?

Mfg Urmel
 
Hi Urmeli,

please have a look at this structure for your webserver configuration files:

...( valid for 12.0 as well! ). This structure shows you explizit the whole webserver configuration files structure, which may point you to your misconfiguration(s). As you can see, your error message already points to a previous setting, which can't be overwritten by a following configuration file in the structure. The mentioned issue "PPP-7504" was already solved and has got nothing to do with your misconfiguration. Please investigate yourself, where in your configuration files you've already defined a "client_max_body_size" directive, which the nginx configuration checker complains now, if you would like to set this as an additional directive for your domain in your domain specific "vhost_nginx.conf"
 
Last edited by a moderator:
Hi UFHH01,

you are right, the error message is correct, there is a dublicate entry of the "client_max_body_size" parameter.
But the second place where the parameter is defined is in the automatically generated file /etc/nginx/plesk.conf.d/vhosts/urmelissubdomain.conf.
As the file is automatically generated, I have no idea how to delete this parameter definition.

I am not toally sure but I think the file /etc/nginx/plesk.conf.d/vhosts/urmelissubdomain.conf. is generated based on the file /psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php.
In this file I can find the line: <?php if (!empty($VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'])): ?>

Is the solution for my problem to delete this line from the template?

Best regards Urmeli
 
Just bumping hoping this gets fixed. This is still an issue in the latest Plesk 12.5. You cannot add the nginx directive "client_max_body_size 50M;" to "additional nginx settings" inside the control panel.
This was promised to be fixed long ago. Why hasn't this happened yet? It's super annoying to modify plesk so much just to get one setting working...
 
Using Plesk v12.5.30_build1205150826.19 and I followed this http://kb.odin.com/en/122689

But now I am getting this error.

Code:
New configuration files for the Apache web server were not created due to the errors in configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = Template_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'h.fp' in 'field list' file: /usr/local/psa/admin/plib/Template/Processor.php line: 28 code: 0 Previous error: Zend_Db_Statement_Exception: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'h.fp' in 'field list' file: /usr/local/psa/admin/externals/Zend/Db/Statement/Pdo.php line: 234 code: 42 Previous error: PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'h.fp' in 'field list' file: /usr/local/psa/admin/externals/Zend/Db/Statement/Pdo.php line: 228 code: 42S22. Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter

Any ideas?
 
Hi Bynot,

please open another thread and try not to mix thread issues - it will not only confuse forum-users, there is as well no reason, why different issues should be investigated in the same thread. As you can see with your error message, the configuration files creation has got nothing to do with "client_max_body_size duplicate Problem still exists", but is caused by a SQL - query issue.
 
Hi Bynot,

please open another thread and try not to mix thread issues - it will not only confuse forum-users, there is as well no reason, why different issues should be investigated in the same thread. As you can see with your error message, the configuration files creation has got nothing to do with "client_max_body_size duplicate Problem still exists", but is caused by a SQL - query issue.

I have to disagree with your response this has happened as a direct response to a supposed fix for client_max_body_size duplicate problem that's why I posted the error here after I applied the supposed fix.
 
Hello.
Plesk v12.5.30_build1205150826.19 os_CentOS 7

panel.log:
nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/oc.humanear.com/conf/vhost_nginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed


This problem still exists..
I prefer to not have to setup large values for each domain, however a temporary fix is to create or modify the panel.ini file.

Create file (if not exist): /usr/local/psa/admin/conf/panel.ini
--Add-----------------------------------------
[webserver]
##nginxClientMaxBodySize = (size in bytes, kilo(k/K), or mega(m/M)
nginxClientMaxBodySize = 512m

Is there an update to this problem?
--john
 
@jprince the workaround proposed by you does not seem to work on my Plesk 12.5.30 (CentOS 7.2).

I added the file /usr/local/psa/admin/conf/panel.ini with the content described above, but after running "/usr/local/psa/admin/bin/httpdmng --reconfigure-all" there is still the 128m default setting by Plesk in place.

I didn't download the ZIP file from https://kb.odin.com/en/122689, since this is proposed for Plesk 12.0 and I don't feel confident with modifying plesk internal files.

It would really be great, if this setting could be used in the nginx configuration of the customer, since e.g. file upload in owncloud installations require larger settings here.
 
I added the file /usr/local/psa/admin/conf/panel.ini with the content described above, but after running "/usr/local/psa/admin/bin/httpdmng --reconfigure-all" there is still the 128m default setting by Plesk in place.

That's because it's the setting for the Plesk Panel server (sw-cp-server), not the server that the domains are hosted on Apache or Nginx.
You would need to modify the templates...

Changing Virtual Hosts Settings Using Configuration Templates

I hope that's a bit clearer.
Kind regards

Lloyd
 
Thanks for thins hint, Llyod!

Using this I could change the default setting for client_max_body_size.

Here is what I did:
Code:
mkdir /usr/local/psa/admin/conf/templates/custom
mkdir /usr/local/psa/admin/conf/templates/custom/domain
cp /usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php

After that you need to modify /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php and replace the following lines:

Code:
<?php if (!empty($VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'])): ?>
    client_max_body_size <?php echo $VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'] ?>;
<?php endif; ?>

with:

Code:
client_max_body_size 512m;

After that you need to recreate the config files using "/usr/local/psa/admin/bin/httpdmng --reconfigure-all".

Now you have the default setting "client_max_body_size 512m;" for every hosted domain.

Anyway, setting this directly in the user interface for the nginx settings of the desired domain would be much nicer.
 
If you are using the fastcgi php module of plesk, you may also need to increase the FcgidMaxRequestLen setting, to allow uploading of files with max. 512 megabyte in owncloud.

This is done by:

Code:
cp /usr/local/psa/admin/conf/templates/default/domain/domainVirtualHost.php /usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php

In the file "/usr/local/psa/admin/conf/templates/custom/domain/domainVirtualHost.php" search for FcgidMaxRequestLen and replace "134217728" with "536870912" for 512m.

After that you need to recreate the config files using "/usr/local/psa/admin/bin/httpdmng --reconfigure-all".
 
Back
Top