title: Apache LimitRequestBody - no effect on SSL/binary data
body: <p>I have a service that accepts attachments as multipart form-data in POST requests. I want to limit the size of attachments the server accepts to prevent abuse.</p>
  
  <p>But I can't get Apache LimitRequestBody configuration parameter to work. The server allways accepts my requests - no matter what I configure. I'm expecting HTTP 413 to be thrown when exceeding the request size.</p>
  
  <p>My setup: Load Balancer -> Apache (v2.2.12) -> Jetty</p>
  
  <p>Here is my apache configuration:</p>
  
  <pre><code>Listen 11443
  
  &lt;VirtualHost _default_:11443&gt;
      LimitRequestBody 102400
      LimitXMLRequestBody 102400
  
      &lt;Location /one/myapp&gt;
          LimitXMLRequestBody 102400
          LimitRequestBody 102400
          SetEnv proxy-sendcl 1
          ProxyPass http://localhost:8080/myapp
          ProxyPassReverse http://localhost:8080/myapp
          Order Deny,Allow
          Allow from all
      &lt;/Location&gt;
  
      ProxyPass /one http://localhost:8080
      ProxyPassReverse /one http://localhost:8080
  
      SSLEngine on
      SSLCertificateFile      ...host.cer
      SSLCertificateKeyFile   ...host.key
      SSLCertificateChainFile ...host.crt
      SSLProxyEngine on
  
  &lt;/VirtualHost&gt;
  </code></pre>
  
  <p>Installed are (among others) mod-ssl and mod-qos.</p>
  
  <p>My request looks like this:</p>
  
  <pre><code>POST https://myhost.com/one/myapp/myressource HTTP/1.1
  Accept-Encoding: gzip,deflate
  Authorization: ...
  Accept-Language: en_US
  Content-Type: multipart/form-data; boundary="----=_Part_16_248..."
  MIME-Version: 1.0
  User-Agent: Jakarta Commons-HttpClient/3.1
  Host: myhost.com
  Content-Length: 5760260
  
  
  ------=_Part_16_248...
  Content-Type: application/octet-stream; name=data.raw
  Content-Transfer-Encoding: binary
  Content-Disposition: form-data; name="file"; filename="data.raw"
  
  ... (binary data) ...
  </code></pre>
  
  <p>Why does LimitRequestBody not work in my case?</p>