Nginx Reverse Proxy
Steps to Configure the Nginx Reverse Proxy
Scripted Build for Installing and Configuring the Nginx Reverse Proxy
There are now 2 scripts available for both CentOS and Ubuntu to automate the proxy build, use the commands below for the desired distribution:
CentOS:
wget https://raw.githubusercontent.com/rubrikinc/rubrik-extension-for-vcd/master/reverse-proxy-builds/centos.shBefore running the script we need to add our Rubrik Cluster IP and DNS for the Reverse Proxy, find and replace the following placeholders in the file (Using VIM or Notepad):
<Reverse Proxy DNS/IP Addresds e.g. rproxy.rubrikdemo.com>: This will be the DNS or IP Address of the Proxy Server
<Upstream Server Placeholder>: This will be the DNS or IP or the Rubrik Cluster
Save the updated script and and run with:
sudo chmod +x ./centos.sh
./centos.shDuring the install you will be asked to provide information regarding the self signed certificates used on the proxy.
Using Signed Certificates
After the proxy is built, you can reconfigure the Certificates, by replacing the following files with your signed certificate and private key:
/etc/tls/crt/STAR_wildcard.crt
/etc/tls/key/STAR_wildcard.keyUbuntu:
Before running the script we need to add our Rubrik Cluster IP and DNS for the Reverse Proxy, find and replace the following placeholders (Using VIM or Notepad):
<Reverse Proxy DNS/IP Addresds e.g. rproxy.rubrikdemo.com>: This will be the DNS or IP Address of the Proxy Server
<Upstream Server Placeholder>: This will be the DNS or IP or the Rubrik Cluster
During the install you will be asked to provide information regarding the self signed certificates used on the proxy.
Save the updated script and and run with:
After the proxy is built, you can reconfigure the Certificates, by replacing the following files with your signed certificate and private key:
Manually Installing and Configuring Nginx Reverse Proxy
The steps below can be used to install and configure Nginx on an RPM-based linux distribution, e.g. RHEL or CentOS. If you are starting from scratch on a new server, configure the network settings, then install and configure Nginx based on the following steps.
Create the Nginx yum repository
Add the following to the nginx.repo file
CentOS:
RHEL:
Install the packages
You should have confirmation that the packages installed successfully.
Navigate to the Nginx Directory
We need to remove the default nginx config and replace it with the reverse proxy config:
Paste the following config (press i first to allow vi to write):
Change directories to the Sites Enabled*
*if sites-enabled doesn't exists, create the directory with:
Create a new nginx site with a name of the linux host
Open the file for editing:
Update the the placeholder in the config below<reverse proxy FQDN> with the FQDN you will be using for this Reverses Proxy e.g. rbk-proxy.rubrik.com.
Paste the following config (press i first to allow vi to write):
Save the file and exit (in vi hit esc to leave insert mode and type :wq! followed by return to save and quit)
Change to the conf.d directory
Create the proxy configuration file
Edit this file with sudo vi proxy-upstream.conf, and add the following content targeting the Rubrik cluster DNS name or IP; update the placeholder <Rubrik DNS Name> with you
Finally, we need to create our Cache directory and Configure SELinux, use the following commands:
Manually Create a Self-Signed Certificate for Nginx Reverse Proxy
If you already have a public/private certificate pair for the certificate you will be using we can create our TLS folder and add the files:
Inside of the crt and key folder create the file as labelled in the proxy config e.g.
If you do not have a certificate, use this guide below to create a self-signed certificate:
https://www.humankode.com/ssl/create-a-selfsigned-certificate-for-nginx-in-5-minutes.
Once complete, restart the Nginx services sudo nginx -s reload. This completes the Reverse Proxy Configuration.
Last updated
Was this helpful?