• 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.

Issue Getting constant 413 error at approx 76MB upload point

akira9000

Basic Pleskian
So, I have a shared hosting account & 2 VPSs ( the 2 VPSs are with different providers so helps provide a constant ). One VPS is on CentOS 6.9 the other on CentOS 7.3. Both are Plesk Onyx 17.5.3. Plenty of RAM, plenty of disk space.
I have an uploader web app/script that works fine on the shared Linux host with some amends to the php.ini such as:

memory_limit = 2048
max_execution_time = 300
upload_max_filesize = 1024M
post_max_size = 1024M

On the shared Linux host I can upload files close to 1GB as you'd expect.

On both VPSs when an upload reaches approx 76MB I get an error - "Error Request Entity Too Large". Same every time irrespective how large the file is. This also seems to **** out at dead on 30secs worth of upload too. Coincidence?

I am pulling my hair out trying to get the uploader to function correctly on the VPSs. I have tried many different PHP versions, makes no difference. The only thing that works is disabling Nginx reverse proxy completely and serving the PHP as plain old CGI, which I really don't want to do. Not just because it's old, mainly because when things don't work I hate not knowing why.

I have tried going into /etc/nginx/nginx.conf and adding client_max_body_size 2000M; but I've got to admit I was flying a little blind as it's the first time I've been tempted to edit the nginx config so I'm not exactly fluent. It didn't resolve anything either. Are there any Apache/nginx defaults that would point to 76MB or 30 secs before I get the dreaded 413 "Error Request Entity Too
Large"?

Worth reiterating, same error on both VPSs, different Linux versions, 2 different providers so it's something default or standard at play here.

Any help greatly appreciated. This is the first major headache I've had for ages!
 
Have you tried to go to Home > Subscriptions > YOUR-DOMAIN.COM > Apache & nginx Settings > Additional nginx directives and specify client_max_body_size parameter there in textbox?
 
I think that might have been where I started troubleshooting but I gave up and moved onto something else. When I add the line:

Code:
client_max_body_size 500M;
I've chosen 500M just as an arbitrary figure just to get started with trying to get the 76MB limit raised, it causes the error in red:
Code:
Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/testdomain.com/conf/vhost_nginx.conf:1 nginx: configuration file /etc/nginx/nginx.conf test failed

So if this has a relation to an existing file that I need to edit, please could you advise which file to SSH?
 
Try to edit this parameter in file /etc/nginx/plesk.conf.d/vhosts/domain.com.conf
 
turned it up all the way to 1280m in that file and still Request Entity Too Large at the 30second mark on the upload
:(

Also this commented out section is that the top of the file

Code:
#ATTENTION!
#
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY,
#SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.

Is this important? I've just rebooted and checked the file. The changes are persistent.
 
Hi akira9000,

pls. copy the sample, which should be existent on your server, to your empty "panel.ini", using the example command ( logged in as user "root" over SSH ):
Code:
cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini
 
Back
Top