Forum OpenACS Q&A: How to correctly configure the reverse proxy.

I have been using the reverse proxy module to have NaviServer/OACS perform authentication and serve some of the URL space from a Node instance. My configuration has been working fairly well, but we have run into a problem with uploading some files. Most files upload fine, but with some we receive 504 Gateway Timeout responses. These responses seem to be size related. I am trying to figure out if this is an issue with the Naviserver reverse proxy configuration or limits set in the Node instance.

Focusing specifically on the ::revproxy::upstream call, I have configured and understand the -url_rewrite_callback arg (see here) and I can see that there are options for three timeouts: -timeout, -sendtimeout, -receivetimeout as well as other args.

What do each of these timeouts affect and where can I go to understand better the other arguments in this call?

Thanks,

-Tony

Collapse
Posted by Tony Kirkham on

I can't seem to figure out how to edit my question so I will respond to it. I have some more details that I would like to add.

I have attempted to set the -timeout and -sendtimeout args to 60 and 120 seconds and it just spins for the specified amount of time and then closes with the error. By setting the -timeout to 1 second I can make most of the uploads fail, so I know that it is affecting the request. The files that upload without a problem are on the order of 30 KB where as the file that has never succeeded is on the order of 740 KB.

Collapse
Posted by Gustaf Neumann on
Which version of NaviServer are you using? There was a change in timeout semantics this year, making the behavior more useful.

How does backend behave? Does it send data incrementally or long time nothing and all data together?

For answering these questions, you can use in revproxy-procs the "verbose" flag, and "ns_logctl severity Debug(connchan) on" (e.g. in ds/shell) to get low-level debug information.

[1] https://bitbucket.org/naviserver/naviserver/commits/177e4e66a54810ed0bf4434ed0e60510584e3b90