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

Collapse
Posted by Gustaf Neumann on

Hi Tony,

i have created now a setup with a reverse proxy and a backend server where POST requests to the reverse proxy are send to the backend. The reverse proxy receives requests with HTTP or HTTPS; the communication between the reverse proxy and the backed happens via HTTP; both servers are on the same physical machine.

I have tested this setup with POST requests of various sizes, but could not replicate your error. So, please try this simple setup in your environment, which we can rule out configuration issues.

To ease replication of the setup I have added a small repository on GitHub for testing (https://github.com/gustafn/ns-revproxy-test), containing everything needed (configuration files, a receiver on the back end, test files).

Start backend and reverse proxy server with the configuration files from the repository (for debugging, start these in different terminals):

 NS_HTTP_PORT=18091 /usr/local/ns/bin/nsd -f -u nsadmin -g nsadmin -t nsd-config-backend.tcl
 NS_HTTPS_PORT=48090 NS_HTTP_PORT=18090 /usr/local/ns/bin/nsd -f -u nsadmin -g nsadmin -t nsd-config-revproxy.tcl

Direct backend requests (port 18091):

curl -v -X POST -T 100KB http://127.0.0.1:18091/receiver.tcl
curl -v -X POST -T 1MB http://127.0.0.1:18091/receiver.tcl
curl -v -X POST -T 10MB http://127.0.0.1:18091/receiver.tcl

Requests to the backend via the Reverse proxy server (http port 18090 https port 48090):

curl -v -X POST -H Expect: -T 100KB http://127.0.0.1:18090/receiver.tcl
curl -v -X POST -H Expect: -T 1MB http://127.0.0.1:18090/receiver.tcl
curl -v -X POST -H Expect: -T 10MB http://127.0.0.1:18090/receiver.tcl

curl -v -k -X POST -H Expect: -T 100KB https://127.0.0.1:48090/receiver.tcl
curl -v -k -X POST -H Expect: -T 1MB https://127.0.0.1:48090/receiver.tcl
curl -v -k -X POST -H Expect: -T 10MB https://127.0.0.1:48090/receiver.tcl

The only thing that i know to be different is the node.js backend, ... but it would be certainly also interesting to know, whether to problem can be replicated just with NaviServers.