Trying to upload large files on a domain via PHP application results in
550 internal server erroror
502 Bad Gatewayerrors
If nginx support is enabled on the server, the domain's Apache error log
/var/www/vhosts/system/example.com/logs/error_logcontains the following record:
mod_fcgid: HTTP request length ... (so far) exceeds MaxRequestLen (1310720)
The domain's nginx error log
/var/www/vhosts/system/example.com/logs/proxy_error_logcontains the following record:
upstream prematurely closed connection while reading response header from upstream
This only works with FPM application served by Apache, otherwise use custom templates
Connect to the server via SSH.
Note: if direct SSH access to the server is not possible, contact server administrator for further assistance.
fcgid.conffile which is located in
/etc/httpd/conf.d/(for RHEL based OS) or
/etc/apache2/mods-available/(for Debian based OS).
FcgidMaxRequestInMemwith the same values in bytes. For example, 1024 MB corresponds to 1073741824 B.
For RHEL-based OS
# service httpd restart
For Debian-based OS:
# service apache2 restart
Warning: restarting Apache would cause downtime for the hosted domains
For specific domains
Go to Domains > example.com > Apache & Nginx settings > Additional directives for HTTP & HTTPS and add the following lines: