Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

Unable to upload file to the website hosted in Plesk when Imunify is present on the server: Request body no files data length is larger than the configured limit

 
apachecentoscloudlinuxdebiandomains

Symptoms

  • Unable to upload a file to a website hosted in Plesk with the following error:

    413 Request entity too large

    Request Entity Too Large
    The requested resource
    /upload-a-file/
    does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit.

  • On uploading a big file via WordPress administrator interface, the following error is shown:

    Unexpected response from the server. The file may have been uploaded successfully. Check in the Media Library or reload the page

  • ModSecurity component is installed and active on the server

  • Imunify360 is installed and active on the server
  • An error that is similar to the following can be found in the Apache error log /var/www/vhosts/example.com/logs/error_log:

    ModSecurity: Request body no files data length is larger than the configured limit (1048576).. Deny with code (413) [hostname "example.com"] [uri "/Backoffice/index.php"] [unique_id "YCK6aBTMZUZFIMPlEoLhpAAAABk"]

    2023-01-22 13:40:52 Error 203.0.113.2 [client 203.0.113.2] ModSecurity: Request body (Content-Length) is larger than the configured limit (134217728). [hostname "example.com"] [uri "/wp-admin/async-upload.php"] [unique_id "ZbEVgLPF684lP2xTCxMAEwAAABg"], referer: https://example.com/wp-admin/media-new.php Apache error

Cause

The error is caused by the limit of the SecRequestBodyNoFilesLimit within the Imunify360 ruleset for ModSecurity being reached, which makes ModSecurity deny the upload action.

Resolution

Proceed to increase the resource necessary ModSecurity limits as follows:

Click on a section to expand

Globally on the server

  1. Log in to the server via SSH.

  2. Create the file zz_modsec2.conf:

    • On CentOS/RHEL/CloudLinux:

      /etc/httpd/conf.d/zz_modsec2.conf

    • On Debian and Ubuntu:

      /etc/apache2/conf.d/zz_modsec2.conf

    and set the following in it with a text editor:

    <IfModule mod_security2.c>
    SecRequestBodyLimit 546870912
    SecRequestBodyNoFilesLimit 546870912
    </IfModule>

    Note:  The Limit below is specified in Bytes and equals 512 Megabytes.

  3.  Restart Apache server:
  • On CentOS/RHEL/CloudLinux:

    # systemctl restart httpd

  • On Debian and Ubuntu:

    # systemctl restart apache2

By specific domain

  1. Log in to Plesk

  2. Go to Domains > example.com > Apache & Nginx Settings and set the following in both the Additional directives for HTTP and Additional directives for HTTPS fields:

    Note: The Limit below is specified in Bytes and equals 512 Megabytes.

    <IfModule mod_security2.c>
    SecRequestBodyLimit 546870912
    SecRequestBodyNoFilesLimit 546870912
    </IfModule>

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Your Complete .htaccess Guide: Including .htaccess Basics and More

Read More »

NGINX vs Apache – Which Is the Best Web Server in 2024?

Read More »

Top Web Servers For Linux And Windows

Read More »
Knowledge Base

Websites on Plesk server are slow or show error 500 or PHP mail cannot be sent: ap_pass_brigade failed

Read More »

Website on Plesk server is not accessible: 504 Gateway Time-out: The timeout specified has expired: [client 203.0.113.2:54693] AH01075: Error dispatching request to

Read More »

Unable to upload large files to website hosted on Plesk for Linux server: End of script output before headers

Read More »

All websites hosted in Plesk are not accessible over HTTPS: 502 Bad Gateway or ERR_CONNECTION_REFUSED

Read More »

Hosting Wiki

  • Django
  • DBMS Interface
  • Server Redundancy
  • Google Cloud CDN
  • Bare Metal Server
  • PhpMyAdmin
  • phpPgAdmin
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • PHP
  • MongoDB
  • HTTP/3
  • HTTP/2
  • Domain
  • WordPress
  • Plesk
  • Lighttpd
  • Apache Tomcat
  • NGINX
  • Apache
  • Web Server
  • DNS Server
  • SSH
  • HTTP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family