I keep getting "The connection was reset" when trying to upload a large file (around 135MB). When I look at the "last_nginx.conf" of the website conf directory it says "client_max_body_size 128m;" I assume that is the upload limit, so how/where do I change it? It says not to bother changing the value in that file because it will only be overwritten. Btw Nginx is enabled via Plesk admin panel.
Asked
Active
Viewed 2,427 times
2 Answers
1
Answer to change vhosts nginx file is this :
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/
add in /usr/local/psa/admin/conf/templates/custom/domain/nginxDomainVirtualHost.php
:
<?php if (file_exists($VAR->domain->physicalHosting->vhostDir . '/conf/nginx.conf')): ?>
include <?php echo $VAR->domain->physicalHosting->vhostDir;?>/conf/nginx.conf;
<?php endif ?>
/usr/local/psa/admin/bin/httpdmng --reconfigure-all #
to apply new configuration for all domains
As result, if domain has conf/nginx.conf
- it will be included into virtual host config.

Sevvlor
- 560
- 1
- 7
- 24

Jizbo Jonez
- 1,230
- 10
- 25
- 41
-2
client_max_body_size does not limit the size of an upload. The upload must be set by the server administrator in the .ini file or you may be able to modify the value within a .htaccess file; read this.
-
php.ini? I already have upload limits set in the websites conf dir : php_admin_value upload_max_filesize 200M php_admin_value post_max_size 400M php_admin_value memory_limit 450M so why do I have to mess with the php.ini now? I put these settings in /var/www/vhosts/example.com/conf/vhost.conf just so I didn't have to set server wide upload limits, I only want these values for one website. – Jizbo Jonez Aug 11 '13 at 22:25
-
1Try changing the **client_body_timeout** (on your nginx configuration) for something bigger (300, maybe). The client_max_body_size should limit the content of the headers, but not the file size. Hope **this** one does help you :) – Skaparate Aug 11 '13 at 22:32
-
wow lots of crap to set up in nginx.conf, I added your suggestion and already had added these in the past : proxy_connect_timeout 800; proxy_send_timeout 800; proxy_read_timeout 800; send_timeout 800; ...it's like are you going to allow me to upload a semi-large file now without giving me freekin errors? lol anyway tried an upload still getting this connection timeout and had client_body_timeout 800; set then restarted nginx. Any other ideas? – Jizbo Jonez Aug 11 '13 at 22:39
-
LOL... It may work (nothing to lose anyway :P). I've found this on the internet: http://snikolau.com/blog/2011-11/upload-nginx-connection-reset/ – Skaparate Aug 11 '13 at 22:56
-
ok I did the reboot, didn't work. Now trying some stuff out of the link you sent, reboot again and see how it goes. – Jizbo Jonez Aug 11 '13 at 23:07
-
no still not working... this is getting stupid now. Anyone got an answer to this "The connection was reset" problem? If I upload 120MB file or under it works fine, but 130MB plus is no go, so whats the cause??? – Jizbo Jonez Aug 11 '13 at 23:12
-
Your first answer seems to be incorrect according to this https://github.com/AKSW/OntoWiki/issues/146 in that client_max_body_size does govern upload size. Regardless, I changed it in /etc/nginx/nginx.conf and it doesn't seem to change the value in /var/www/vhosts/example.com/conf/last_nginx.conf which is still set to 128M... it kindof explains also why 120MB file uploads without a problem and 130MB doesn't yeah? So anyway, wtf... where do I change this? lol – Jizbo Jonez Aug 12 '13 at 07:59
-
Dude you sent me in the wrong direction, it's all about client_max_body_size apparently http://developer24hours.blogspot.com.au/2013/03/nginx-client-intended-to-send-too-large.html cheers for that... my question still remains, how do I get that value to change in /var/www/vhosts/example.com/conf/last_nginx.conf I have already changed /etc/nginx/nginx.conf but that does nothing to the file in question, it remains at 128M – Jizbo Jonez Aug 12 '13 at 08:29
-
who is the silly goose pressing on vote up... the issue remains and there has also been a similar question asked I just found that was not answered correctly by anyone http://stackoverflow.com/questions/16927479/plesk-nginx-uploading-issue vote down... – Jizbo Jonez Aug 12 '13 at 08:58
-
Hmm, sorry then for misleading you... it's just that the reset connection is related to the waiting time of the link between the server and the client, so I thought that modifying the client_body_timeout would solve the problem (I still think that's related to the timeout - maybe both things). – Skaparate Aug 12 '13 at 16:22