Skip to content

Register now for our Web Enablement Ecosystem webinar!

  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Contact us: +34 944 58 06 58
  • Plesk Partner Program
  • Plesk Lifecycle Policy
  • Blog
  • Contact us
  • Plesk 360
  • Solutions
    By Role
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    • Developers
    • Content Managers
    • Digital Agencies
    • IT Admins
    • Web Hosters
    • Hyperscalers
    By Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    • Web Admin Edition
    • Web Pro Edition
    • Web Host Edition
    • Business & Collaboration
    • Plesk WP Edition
    By Cloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    • Amazon Web Services
    • Microsoft Azure
    • Alibaba Cloud
    • GCP Marketplace
    • Vultr
    • DigitalOcean
    • Linode
    • UpCloud
    Partner Program
    Exclusive discounts, benefits and exposure to take your business to the next level
    Become a partner
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    Explore Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    • Everyone
    • Admins & Web Hosters
    • Developers
    • Designers & Agencies
    • Plesk Features
    Key Topics
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder
    • SEO Toolkit
    • Joomla! Toolkit
    • Plesk Premium Email
    • Plesk Email Security
    Feature Packs
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    • Business & Collaboration
    • WP Pack
    • Hosting Pack
    • Power Pack
    • Language Pack
    Featured Extension
    SocialBee
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • Extension
  • Pricing
  • Extensions
  • Help Center
  • More
    • Careers
    • Events
    • Plesk University
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL
  • Solutions
    • By Role
      • Developers
      • Content Managers
      • Digital Agencies
      • IT Admins
      • Web Hosters
      • Hyperscalers
    • By Edition
      • Web Admin Edition
      • Web Pro Edition
      • Web Host Edition
      • Business & Collaboration
      • WP Edition
    • By Cloud
      • Amazon Web Services
      • Microsoft Azure
      • Alibaba Cloud
      • GCP Marketplace
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
    • Partner Program
      • Partner Program
  • Product
    • Explore Features
      • Everyone
      • Admins & Web Hosters
      • Developers
      • Designers & Agencies
      • Plesk Features
    • Key Topics
      • SocialBee
      • WP Toolkit
      • Sitejet Builder
      • SEO Toolkit
      • Joomla! Toolkit
      • Plesk Premium Email
      • Plesk Email Security
    • Feature Packs
      • Business & Collaboration
      • WP Pack
      • Hosting Pack
      • Power Pack
      • Language Pack
    • Featured Extension
      • SocialBee
  • Pricing
  • Extensions
  • Help center
  • More
    • Careers
    • Events
    • Plesk University
    • Blog
    • Plesk Partner Program
    • Contact Us
  • FREE TRIAL

Knowledge Base

How to increase client request header buffer size due to 400 Bad Request errors

 
apachecookiesddosdnsdomains

Question

  • How to increase client request header buffer size, in order to resolve common 400 Bad Request errors?

Answer

This can be achieved by adding directives to Apache and/or Nginx depending on your configuration.

How it Works

  1. For Nginx, when a client sends a request line or request header, the directive client_header_buffer_size is used, which allows for header lines or requests to be a maximum of 1024 bytes, by default. This is sufficient for most requests. However, if a request includes long cookies, or comes from a WAP client, it may not fit into 1024 bytes. If a header line or request does not fit into this buffer then the directive large_client_header_buffers is used, which by default is 8190 bytes.

  2. For Apache, by default, the directive LimitRequestFieldSize is used to determine the max size of a header lines or request which is 8190 bytes.

  3. For Apache with Nginx, the request header is first sent to Nginx as it is the reverse proxy, and if you have Smart static files processing enabled as shown in this article, and the page is static, Nginx will skip Apache and send the page straight to the client. Otherwise, if Smart static files processing is disabled, or the client is requesting a dynamic page, the request header will be sent in full to Apache, which will then pass the page back to Nginx to send to the client. This means it will be necessary to increase the value for both Nginx and Apache.

    Note: When name-based virtual hosting is used, the value for this directive is taken from the default (first-listed) virtual host that best matches the current IP address and port combination. Plesk uses name-based virtual hosting only. Therefore, if your domain is using Apache, you must apply this globally as you cannot apply it to a single domain alone.The only way around this is to use Nginx-only hosting for the domain in question.

    Due to the above note, the preferred solution is the Nginx-Only Hosting option. As applying this globally increases the potential for the server to be affected by DDoS attempts, as it increases the allowed header request size for every domain on the server.
    Even if Apache and Nginx are used together, because it's possible to bypass Nginx and reach Apache directly on port 7080 & 7081.

Nginx-Only Hosting (For Single Domain)

  1. Log into Plesk
  2. Following this article, add an Nginx Directive by going to Domains > example.com > Hosting & DNS > Apache & nginx Settings and add the following line to Additional nginx directives, then hit Apply.

    large_client_header_buffers 4 16k;

    Note: Edit 16k to match the desired request buffer size, keeping in mind that 8k is the default, and that the larger the buffer size the greater the impact from a DDoS attack. Also, in order for this to work you must have Proxy mode disabled for the domain you are applying. Please refer to this article for instructions.

Apache-Only Hosting (For Global)

  1. Connect…

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 »

DNS_PROBE_FINISHED_NXDOMAIN: What Is It And How To Fix The Problem

Read More »
Knowledge Base

Pages of a website hosted in Plesk fail to load: Size of a request header field exceeds server limit

Read More »

Domain is down on Plesk: HTTP Error 403.503 – Forbidden

Read More »

How to set up nginx to log real client IP address when the Plesk server is behind an external proxy server

Read More »

How to serve the content of a different website in Plesk for Linux?

Read More »

Hosting Wiki

  • Server Redundancy
  • DDoS
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • JavaScript
  • Domain
  • Hosting Control Panel
  • Plesk
  • Apache Tomcat
  • NGINX
  • Apache
  • Web Server
  • Static DNS
  • DNS Server
  • DNS Forwarding
  • Reverse DNS
  • IPv6
  • IPv4
  • SIP
  • UDP/IP
  • Colocation Hosting
  • Reseller Hosting
  • Cloud Hosting
  • VPS Hosting
  • Dedicated Hosting
  • Shared Hosting
  • Free Hosting
  • Managed Hosting
  • TCP/IP

Industry
Partners

industry-partner_ALIBABA
industry-partner_GOOGLEPARTNER
industry-partner_MICROSOFT
industry-partner_REDHAT-r2
industry-partner_ALIBABA
industry-partner_AUTOMATTIC
industry-partner_AWS
industry-partner_DIGITALOCEAN
industry-partner_SCALEWAY
Follow us:
Facebook Twitter Linkedin Youtube Github

COMPANY

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY

Blog
Forums 
Plesk University

First defaul

Company

About Plesk
Our Brand
Legal
Careers
Impressum

PRODUCT

Pricing 
Extensions
What’s new

KNOWLEDGE BASE​

Documentation
Help Center
Migrate to Plesk
Contact Us
Hosting Wiki
Preview releases

PROGRAMS​

Contributor Program NEW
Partner Program
Affiliate ProgramNEW

COMMUNITY​

Blog
Forums
Plesk University

Follow us:
Facebook Twitter Linkedin Youtube Github

© 2025 WebPros International GmbH. All rights reserved. Plesk and the Plesk logo are trademarks of WebPros International GmbH.

Managed with love with Plesk WP Toolkit