• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Question ERR_CONNECTION_ABORTED when I upload files

nitsik

New Pleskian
Hello, sorry for my English, I'm from Ukraine, I use plesk.
When I upload big files (for example, two files size 200 MB each), I see messege ERR_CONNECTION_ABORTED in Chrome. (progress show only 2% upload before error)
I use
memory_limit 512M
post_max_size 512M
upload_max_filesize 512M
max_execution_time 300
max_file_uploads 20
in apache config
and
client_max_body_size 512m;
in nginx config.
Why ERR_CONNECTION_ABORTED happend?
At logs nginx and apache i not see errors about it.
Thank you.
 
Hi nitsik,

pls. consider to adjust your PHP - settings to your needs. You find these PHP settings for EVERY domain/subdomain at "Home > Subscriptions > EXAMPLE.COM > Websites & Domains"
 
When I try to add
client_max_body_size 2000m;
to "Additional nginx directives"
I see
Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/domain.ru/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
but file /var/www/vhosts/system/domain.ru/conf/vhost_nginx.conf is empty
I changed file /var/www/vhosts/system/domain.ru/conf/nginx_ip_default.conf and set
client_max_body_size 2000m;
everywhere
and now progress show 100% in browser, but I see
500 Internal Server Error
 
Hi nitsik,

if you would like to change the "client_max_body_size" for a domain, pls. consider to adjust that as "Additional nginx directives" and put in the textbox for example "client_max_body_size 512m", followed by the command

plesk sbin httpdmng --reconfigure-domain YOUR-DOMAIN-NAME

Manual changes in your configuration files can not only cause issues, the manual changes will get overwritten as well, when the configuration files are re-generated by Plesk.
 
I add to "Additional nginx directives"

client_max_body_size 2000m;
plesk sbin httpdmng --reconfigure-domain my-domain-name

but I see

Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/my-domain-name/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed
 
I don't have file /usr/local/psa/admin/conf/panel.ini, but I have file /usr/local/psa/admin/conf/panel.ini.sample. Must I create file /usr/local/psa/admin/conf/panel.ini ?
 
/usr/local/psa/admin/conf/panel.ini is Plesk panel config file and it must be there. You can create it at least with

# cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini
 
I do cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini
I add nginxClientMaxBodySize = 2000m to /usr/local/psa/admin/conf/panel.ini
I do
plesk sbin httpdmng --reconfigure-all
and
service nginx restart
I add
to "Additional nginx directives"

client_max_body_size 2000m;

but I see

"Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/my-domain-name/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed"
again...
And now I see message ERR_CONNECTION_ABORTED in Chrome again when I upload big files.
 
Hi nitsik,

apart from the fact, that I really don't know a situation right now, why someone want to have 2000 ( !!! ) MB for the "client_max_body_size" configuration, are you aware of this comment at the KB - article?

All domains that do not have the custom value for this directive, will get a default one from /usr/local/psa/admin/conf/panel.ini

Pls. check your domain - specific configuration files and investigate, if you don't already HAVE the desired "client_max_body_size = 2000m" at "/var/www/vhosts/system/YOUR-DOMAIN.COM/conf/*".
 
I have
client_max_body_size 128m;
in /var/www/vhosts/system/MY-DOMAIN.COM/conf/nginx_ip_default.conf
What I must to do?
I want to have 2000m because I want to upload big files in my site (more than 200-300MB, perhaps 1GB and more)
And now I try to upload 170MB file and see in logs
"mod_fcgid: HTTP request length 134222678 (so far) exceeds MaxRequestLen (134217728), referer: http://url"
 
Last edited:
Hi nitsik,

the default settings are defined in the default Plesk configuration templates, pls. use the command:

find /usr/local/psa/admin/conf/templates -type f -name "*.php" -exec grep -i -H "client_max_body_size" {} \;

to investigate, if you probably got old templates on your server, or if you probably got CUSTOM templates on your server, which are used instead of the default ones.
 
I see
/usr/local/psa/admin/conf/templates/default/nginxWebmailPartial.php: client_max_body_size 128m;
/usr/local/psa/admin/conf/templates/default/domain/nginxDomainVirtualHost.php: client_max_body_size <?php echo $VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'] ?>;
 
Hi nitsik,

/usr/local/psa/admin/conf/templates/default/nginxWebmailPartial.php: client_max_body_size 128m;
You have TWO choices now to solve your issue:

1. possible solution ( recommended ):

Copy the default Plesk template to a CUSTOM directory and modify the custom template, so that "client_max_body_size" will be configured the same way as with "nginxDomainVirtualHost.php".

Code:
mkdir /usr/local/psa/admin/conf/templates/custom/
cp /usr/local/psa/admin/conf/templates/default/nginxWebmailPartial.php /usr/local/psa/admin/conf/templates/custom


Edit /usr/local/psa/admin/conf/templates/custom/nginxWebmailPartial.php

Search for:
Code:
client_max_body_size 128m;

Replace with:
Code:
client_max_body_size <?php echo $VAR->domain->physicalHosting->proxySettings['nginxClientMaxBodySize'] ?>;


Rebuild your configuration files with the command:

/usr/local/psa/admin/sbin/httpdmng --reconfigure-all


2. possible solution ( NOT recommended ):

You could edit the current default Plesk template "/usr/local/psa/admin/conf/templates/default/nginxWebmailPartial.php" and modify the template to the desired "client_max_body_size 2000m;".
Pls. be aware that your changes may be overwritten in case of updates/upgrades/patches and all your changes could be lost.
If you choose this solution, rebuild the configuration templates with "/usr/local/psa/admin/sbin/httpdmng --reconfigure-all" afterwards and pls. be aware, that you now have your own, unique setting in your Webmail - configuration files.


When you used solution no. 1, you should now be able to change your domain - specific "client_max_body_size 2000m" afterwards over the Plesk Control Panel at "Additional nginx directives" for your desired domain(s).
 
I do first choise and then I see in Websites and Domains
New configuration files for the Apache web server were not created due to the errors in configuration templates: Template processing failed: file = /opt/psa/admin/conf/templates/default/nginxWebmail.php, error = Template_Exception: Incomplete metainfo, domainId undefined. file: /opt/psa/admin/plib/Template/Processor.php line: 28 code: 0 Previous error: Template_Exception: Incomplete metainfo, domainId undefined. file: /opt/psa/admin/plib/Template/Processor.php line: 28 code: 0 Previous error: Template_Variable_Exception: Incomplete metainfo, domainId undefined. file: /opt/psa/admin/plib/Template/Variable/Domain.php line: 29 code: 0. 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.
 
Hi nitsik,

if you went step-by-step, then your default "nginxWebmail.php" would not be used anymore, instead your custom template would be used at "/usr/local/psa/admin/conf/templates/custom/nginxWebmailPartial.php".

Pls. be aware, that IF you use "copy&paste" from the forum, to paste provided commands or code, it might be the case that you copy HTML formats from the forum as well, which might be invisible on your command line. Consider to copy the desired commands and/or code over to "notepad" ( or any similar pure ASCII - code editor ) first and copy the commands and/or code from there again, to paste it over to your command line. You can avoid pasting forum formats with this procedure. ;)
If you want to be sure, that you didn't copy forum formats, to could as well TYPE the commands or the code, in order to avoid copy&paste - issues.
 
I copied all strings to notepad and then copy from notepad to putty, and to notepad++ when I change nginxWebmailPartial.php, and than I upload nginxWebmailPartial.php to server by FTP, do /usr/local/psa/admin/sbin/httpdmng --reconfigure-all in putty and then update page with plesk, but I see message above again.
 
Hi nitsik,

please move the CUSTOM template folder to a location, where you might investigate your template(s) and possible misconfigurations ( compare them for example with "Notepad++" and investigate possible misconfigurations ) and rebuild your configuration files with the standard Plesk templates. Make sure, that your ADDITIONAL directives are removed, before you rebuild the standard configuration files!!!

Code:
mkdir /usr/local/psa/admin/conf/templates/temp_to_investigate
mv -if /usr/local/psa/admin/conf/templates/custom/* /usr/local/psa/admin/conf/templates/temp_to_investigate/
/usr/local/psa/admin/sbin/httpdmng --reconfigure-all

Afterwards, pls. make sure, that the CUSTOM templates are really without misconfigurations, before you move them back to your custom folder, followed by the rebuild command to use the custom templates instead of the default ones.
If you experience issues with custom templates and need help with the investigations, consider to post the corresponding files as forum attachments, so people willing to help you don't have to guess possible misconfigurations. :)
 
Back
Top