RCT Reverse Proxy Configurations
Configuring Nginx to use with Deliver clustered environment as reverse proxy and load balancer
To configure Nginx to use with Deliver clustered environment as reverse proxy and load balancer, complete the following steps:
- Edit the Nginx configuration record with elevated rights.
- Define an upstream element and list every node in your backend cluster.
- Map a URI to the upstream cluster with a proxy_pass area setting.
- Restart or reload the Nginx server to incorporate the config modifications.
- Verify the configuration of the Nginx load balancer setup.
Defining an upstream element
Example:
upstream samplecluster
{
server <backend server1>:2001;
server <backend server2>:2001;
}
Note: Deliver RCT listens on port 2001 for API requests and
receives JSON payload containing response data. You can also mention the weight of
the server based on the requirement. Example server:
backendserver1.example.com weight=5
. For more details, see
http://nginx.org/en/docs/http/ngx_http_upstream_module.html.Defining an upstream element
The Nginx load balancer can act as a reverse proxy. To do that, Nginx needs to recognize the URLs it need to forward requests to the workload controlled cluster. You must configure a region detail with an Nginx proxy_pass entry in the default configurations. Check out the following example:
location /deliver/responses/inetresp
{
client_max_body_size 100M;
proxy_set_header content-type "application/json";
proxy_method POST;
proxy_pass http://samplecluster/deliver/responses/inetresp ;
}
Note: –delivercluster is the name that
needs to be used while calling the Deliver API. Example:
http://delivercluster/deliver/responses/inetresp
along with
JSON payload. Caller machine must contain an entry of IP of the machine where Nginx
is running against the name of upstream element. In above example the host file must
contain the following
entry:<Nginx server IP> delivercluster
Restarting/Reloading the Nginx server
Run the following commands:
systemctl stop nginx
systemctl start nginx
nginx -s reload
Verifying the configuration
Run the following command:
systemctl status nginx