# External Load Balancing using NGINX

Following steps are to deploy NGINX load balancer on preconfigured HPECP cluster with HA.

Pre-requisite

  • HPECP Controller setup and Gateway with HA

# Deployment Process

  1. Install nginx on the separate VM with CentOS 7

    > yum install -y nginx
    
  2. Create a " load-balancer.conf" file in the following path /etc/nginx/conf.d:

Sample load-balancer configuration file

  1. Change the permissions for the load-balancer.conf file.

    > chmod 0777 /etc/nginx/conf.d/load-balancer.conf
    
  2. If you have trouble loading the page, check firewall is not blocking your connection. For example: on CentOS 7 the default firewall rules do not allow HTTP traffic, enable it with the commands below.

  > firewall-cmd --add-service=http --permanent

  > firewall-cmd --reload
  1. Comment out the existing server information details in the /etc/nginx/nginx.conf file as shown below.

  2. Restart and enable nginx service:

    > systemctl enable nginx.service**
    
    > systemctl restart nginx.service**
    
    > systemctl status nginx.service**
    

    NOTE

    NGINX service should be Active and running.

  3. Navigate to the NGINX configured IP on browser and HPECP gateway page should come up:

  4. Logs can be checked in following path CLI /var/log/nginx on nginx server.