title: Apache2 Proxy Error:Error reading from remote server
body: <p>Environment:</p>
  
  <ul>
  <li>Apache2</li>
  <li>nanohttpd (web server (java))</li>
  </ul>
  
  <p>The site itself is and has been working fine, I have added alot of entries to a database which the nanohttpd web server returns on some endpoints</p>
  
  <p>I have figured out that is has todo with the length of the site being returned since when I move entries from one status to another, the one with alot of entries will always give me this error.</p>
  
  <p>I already looked around a bit and think it may be a timeout issue but I have added timeouts to my virtual host and this problem still persists</p>
  
  <pre><code>Proxy Error
  The proxy server received an invalid response from an upstream server.
  The proxy server could not handle the request GET /foo
  
  Reason: Error reading from remote server
  
  Apache/2.4.10 (Debian) Server at foo.foo.foo Port 443
  </code></pre>
  
  <p>My current VirtualHost file for this:</p>
  
  <pre><code>&lt;IfModule mod_ssl.c&gt;
      &lt;VirtualHost *:443&gt;
              ServerAdmin webmaster@localhost
              DocumentRoot /var/www/directory
  
              ServerName foo.foo.foo
              ServerAlias foo.foo.foo
  
              ProxyPass "/" "http://foo.com:8080/"
              ProxyPassReverse "/" "http://foo.com:8080/"
  
              ErrorLog ${APACHE_LOG_DIR}/error.log
              CustomLog ${APACHE_LOG_DIR}/access.log combined
  
              Include /etc/path/options-ssl-apache.conf
              SSLCertificateFile /etc/path/foo.com-0001/fullchain.pem
              SSLCertificateKeyFile /etc/path/foo.com-0001/privkey.pem
      &lt;/VirtualHost&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>What I had tried earlier was adding timeout=x and connectiontimeout=x behind ProxyPass but this didnt seem to help</p>
  
  <p>Edit:
  Since there is still no answer here is some more info, I will add a bounty once eligible.</p>
  
  <p>As you can see in my VirtualHost file I am using Apache Reverse Proxy to enable SSL for my application</p>
  
  <p>So my little nanohttpd server basically returns a very simplistic html page with a table and a row for each database entry. If the specific category has more than around 100 entries I will get the Proxy Error message.</p>
  
  <p>At this point I am very certain that it has todo with something timeing out but I have went through so many posts and tried to add configs to mine and (yes I restarted Apache2 after every change) nothing worked so far.</p>
  
  <p>Could it be something on my nanohttpd server that I am missing?
  A simple Header or Cookie, I am sending none of those as of now.</p>
  
  <p>If any required information is missing please let me know.</p>