Uploading of big file size fails: client intended to send too large body

Created:

2017-07-30 21:49:25 UTC

Modified:

2017-08-16 15:43:39 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Uploading of big file size fails: client intended to send too large body

Applicable to:

  • Plesk for Linux

Symptoms

Uploading of big file size fails with the following error in /var/www/vhosts/system/example.com/logs/proxy_error_log file:

[error] 6045#0: *1543600 client intended to send too large body: 163625628 bytes, client: 203.0.113.2, server: example.com, request: "POST /attachments/uploading.json?hash=bb192e03d44f11110881f1c148ef629&content_type=resource_version&key=resource HTTP/1.1", host: "203.0.113.2", referrer: "https://203.0.113.2/resources/add?resource_category_id=13"

Nginx support is enabled on the server:

# /usr/local/psa/admin/bin/nginxmng -s
Enabled

Adjusting of client_max_body_size in /etc/nginx/nginx.conf has no effect

Cause

Value for client_max_body_size directive is overwritten on domain level and is insufficient.

Resolution

  1. Add the following directives to /usr/local/psa/admin/conf/panel.ini file to customize Plesk defaults:

    [webserver]
    
    nginxClientMaxBodySize = 2000m

    If there is no /usr/local/psa/admin/conf/panel.ini file, create it from the sample file:

    # cp /usr/local/psa/admin/conf/panel.ini.sample /usr/local/psa/admin/conf/panel.ini
    
  2. Rebuild web server configuration files:

    # plesk sbin httpdmng --reconfigure-all
    
    WARNING: Execution of the command above could cause a significant downtime of the hosted websites if there are a big number of them. Perform such action during the maintenance timeframe
  3. Adjust settings of PHP handler assigned to the domain. Go to Plesk > Tools & Settings > PHP Settings > X.X.XX FPM application in php.ini tab and adjust the following parameters, e.g.:

    post_max_size 2000m
    
    upload_max_filesize 2000m
    max_file_uploads 100
Have more questions? Submit a request
Please sign in to leave a comment.