• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

client intended to send too large body

Daniel123

New Pleskian
Hello,

I have been using Plesk for a while on my server, but this is the first time that I need to set up large files uploading for a client who requires to upload via a form files that are larger than 128MB (but less than 400).

The issue I've been seeing is that whenever the user tries to upload a file greater than 128MB I see an error on the proxy_error_log that says:

2015/05/10 21:46:18 [error] 31224#0: *9 client intended to send too large body: 175420278 bytes, client: XX.XX.XX.XX, server: myserver.com , request: "POST /admin/products/1 HTTP/1.1", host: "myserver.com", referrer: "referrer"

I've been googling this issue and everything points to the nginx configuration (PHP parameters have already been set up). I proceeded to change the configuration of /etc/nginx/nginx.conf to include

http {
...
client_max_body_size 400M;
...
}

HOWEVER (and this is where I'm stuck) after restarting the nginx service, the fille /etc/nginx/plesk.conf.d/vhosts/myserver.com.conf continues to hold the value:

server {
...
client_max_body_size 128m;
...
}

Modifying this file to change the 128m to 400m does not make a difference.

Any thoughts or recommendations would be greatly appreciated!
 
Hi Daniel123,

please keep in mind, that additional nginx settings are done over the Plesk Control Panel at your domain specific webserver settings "Additional nginx directives" ( Websites & Domains > YOUR - Domainname > Web Server Settings ) and will result in entries at "/var/www/vhosts/system/YOUR_DOMAIN.COM/conf/vhost_nginx.conf".


If you experience issues, while adding additional nginx settings, as for example:
Code:
Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate
... please visit the Parallels/Odin Knowledge Base :

 
Thank you for the reference.

However, there's no panel.ini anywhere in my server, just a panel.ini.sample

Thoughts?
 
Hi Daniel123,

the SAMPLE might be copied to "/usr/local/psa/admin/conf/panel.ini" in order to work with the desired configurations.
 
Ok, so I already did that, followed the instructions as suggested.

Restarted the nginx service, but when trying to add the client_max_body_size directive, I keep getting the same error:

Invalid nginx configuration: nginx: [emerg] "client_max_body_size" directive is duplicate in /var/www/vhosts/system/myserver.com/conf/vhost_nginx.conf:2 nginx: configuration file /etc/nginx/nginx.conf test failed

I can confirm the new panel.ini seems to be working, because the value of client_max_body_size in /etc/nginx/plesk.conf.d/vhosts/myserver.com.conf is the same as in panel.ini
 
Hi Daniel123,

when you used "/usr/local/psa/admin/bin/httpdmng --reconfigure-all" to reconfigure your configuration files, your additional definitions from your "panel.ini" will conflict with additional settings at "/var/www/vhosts/system/YOUR_DOMAIN.COM/conf/vhost_nginx.conf", as you can see in your error message - you should use either one or the other method as described earlier to avoid double entries.
 
Last edited by a moderator:
Removed any client_max_body_size entries from /etc/nginx/plesk.conf.d/vhosts/myserver.com.conf, restarted nginx and tried uploading a large file again. However the problem points now to a different component.

From error_log:

[Tue May 12 13:23:51 2015] [warn] [client 142.46.224.10] mod_fcgid: HTTP request length 134223089 (so far) exceeds MaxRequestLen (134217728), referer:

Looks like fcgid still needed to be configured. So I took a similar approach as before, and added the directive FcgidMaxRequestLen 400000000 as an additional directive for HTTP. Saved, restarted Apache and everything works now.
 
Back
Top