title: Apache HTTPD close connection or does not redirect request to servlet container
body: <p>We have a system includes two parts:</p>
  
  <p>Part I:
  A Servlet with "/aaa" url mapping.</p>
  
  <p>Part II:
  A simple socket program which connects to our servlet and streams binary data.</p>
  
  <p>The system works fine but, after coming an Apache HTTPD between two parts (our servlet and socket program), the HTTPD prevents data stream.</p>
  
  <p>In the other word, the HTTPD does not redirect request to the Tomcat, I think it waits to receive request completely.</p>
  
  <p>Request header for start out streaming is:</p>
  
  <pre><code>POST /aaa HTTP/1.1
  Host: mysite.com
  Content-Type: application/octet-stream
  Content-Length: 2147483647
  connection: keep-alive
  </code></pre>
  
  <p>If I replace <code>Content-Length: 2147483647</code> header with <code>Transfer-Encoding: chunked</code>, the request will not be redirected to servlet.</p>
  
  <p>Also if I set the <code>Content-Length</code> to a smaller value, the request will be redirected to servlet but, the connection will be closed.</p>
  
  <p><strong>Edit1:</strong>
  The following lines has been come in apache error_log file repeatedly</p>
  
  <pre><code>[Wed Sep 07 07:30:34.180585 2016] [proxy_http:error] [pid 2253:tid 140090191890176] [client 162.93.19.34:45769] AH01114: HTTP: failed to make connection to backend: 127.0.0.1, referer: example.com/aaa/
  [Wed Sep 07 07:30:34.180700 2016] [proxy:error] [pid 2253:tid 140090191890176] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.0.1:12007 (127.0.0.1) failed
  
  [Wed Sep 14 06:25:18.406899 2016] [proxy_http:error] [pid 27777:tid 140089871005440] (70008)Partial results are valid but processing is incomplete: [client 162.93.19.34:60284] AH01110: error reading response
  </code></pre>
  
  <p>What is your suggestion for an HTTP header to work this correctly?</p>
  
  <p>Thanks in Advanced.</p>