Search code examples
javaserverproxyapache2nanohttpd

Apache2 Proxy Error:Error reading from remote server


Environment:

  • Apache2
  • nanohttpd (web server (java))

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

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.

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

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

My current VirtualHost file for this:

<IfModule mod_ssl.c>
    <VirtualHost *:443>
            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
    </VirtualHost>
</IfModule>

What I had tried earlier was adding timeout=x and connectiontimeout=x behind ProxyPass but this didnt seem to help

Edit: Since there is still no answer here is some more info, I will add a bounty once eligible.

As you can see in my VirtualHost file I am using Apache Reverse Proxy to enable SSL for my application

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.

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.

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.

If any required information is missing please let me know.


Solution

  • Well funnily enough I figured it out and I feel horrible now.. The table data I was inserting included a dollar sign and apparently I did not think of escaping the replacement String