ReverseProxy Timeout configuration

NethServer Version: 7.9.2009
Module: Web Server

I have a nodeJS application being served by a reverse proxy. I notice that any of my long-running calls get a 502 error like this:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>502 Proxy Error</title>
</head><body>
<h1>Proxy Error</h1>
<p>The proxy server received an invalid
response from an upstream server.<br />
The proxy server could not handle the request <em><a href="/t/instances/create">GET&nbsp;/t/instances/create</a></em>.<p>
Reason: <strong>Error reading from remote server</strong></p></p>
</body></html>
* Connection #0 to host my.site.com left intact

and in the apache log I can see:
[Wed Mar 03 01:06:10.985888 2021] [proxy_http:error] [pid 17771] (20014)Internal error: [client 46.7.118.40:39394] AH01102: error reading status line from remote server localhost:3000
[Wed Mar 03 01:06:10.986371 2021] [proxy:error] [pid 17771] [client 46.7.118.40:39394] AH00898: Error reading from remote server returned by /t/instances/create

I suspect it’s due to a timeout, because if I try to connect to the same endpoint again it has no issue.

Has anyone experienced this, and if so - can you advise on the current way to fix this issue of the connection breaking while being proxied? I see some other posts on how to do increase the timeout but they require configuration changes and are a bit old.

Maybe setting setting “ProxyTimeout 600” helps (default is 60 seconds).

2 Likes

Thanks - but the action is already less than 60 seconds, it’s more like 10 seconds, so I think it may be another issue.

The apache errors were a red herring and it was completely unrelated. My application did have errors and was throwing exceptions. Thanks for the help!