--- title: Setting up Amazon ELB Network Load Balancer ---
This how-to guide describes how to set up a Network Load Balancer (NLB) in Amazon's EC2 service that will direct traffic to multiple instances on EC2. These examples show the load balancer being configured to direct traffic to three Rancher server nodes. If Rancher is installed on an RKE Kubernetes cluster, three nodes are required. If Rancher is installed on a K3s Kubernetes cluster, only two nodes are required. This tutorial is about one possible way to set up your load balancer, not the only way. Other types of load balancers, such as a Classic Load Balancer or Application Load Balancer, could also direct traffic to the Rancher server nodes. Rancher only supports using the Amazon NLB when terminating traffic in `tcp` mode for port 443 rather than `tls` mode. This is due to the fact that the NLB does not inject the correct headers into requests when terminated at the NLB. This means that if you want to use certificates managed by the Amazon Certificate Manager (ACM), you should use an ALB. ## Requirements These instructions assume you have already created Linux instances in EC2. The load balancer will direct traffic to these nodes. ## 1. Create Target Groups Begin by creating two target groups for the **TCP** protocol, one with TCP port 443 and one regarding TCP port 80 (providing redirect to TCP port 443). You'll add your Linux nodes to these groups. Your first NLB configuration step is to create two target groups. Technically, only port 443 is needed to access Rancher, but it's convenient to add a listener for port 80, because traffic to port 80 will be automatically redirected to port 443. Regardless of whether an NGINX Ingress or Traefik Ingress controller is used, the Ingress should redirect traffic from port 80 to port 443. 1. Log into the [Amazon AWS Console](https://console.aws.amazon.com/ec2/) to get started. Make sure to select the **Region** where your EC2 instances (Linux nodes) are created. 1. Select **Services** and choose **EC2**, find the section **Load Balancing** and open **Target Groups**. 1. Click **Create target group** to create the first target group, regarding TCP port 443. :::note Health checks are handled differently based on the Ingress. For details, refer to [this section.](#health-check-paths-for-nginx-ingress-and-traefik-ingresses) ::: #### Target Group (TCP port 443) Configure the first target group according to the table below. | Option | Setting | |-------------------|-------------------| | Target Group Name | `rancher-tcp-443` | | Target type | `instance` | | Protocol | `TCP` | | Port | `443` | | VPC | Choose your VPC | Health check settings: | Option | Setting | |---------------------|-----------------| | Protocol | TCP | | Port | `override`,`80` | | Healthy threshold | `3` | | Unhealthy threshold | `3` | | Timeout | `6 seconds` | | Interval | `10 seconds` | Click **Create target group** to create the second target group, regarding TCP port 80. #### Target Group (TCP port 80) Configure the second target group according to the table below. | Option | Setting | |-------------------|------------------| | Target Group Name | `rancher-tcp-80` | | Target type | `instance` | | Protocol | `TCP` | | Port | `80` | | VPC | Choose your VPC | Health check settings: | Option |Setting | |---------------------|----------------| | Protocol | TCP | | Port | `traffic port` | | Healthy threshold | `3` | | Unhealthy threshold | `3` | | Timeout | `6 seconds` | | Interval | `10 seconds` | ## 2. Register Targets Next, add your Linux nodes to both target groups. Select the target group named **rancher-tcp-443**, click the tab **Targets** and choose **Edit**.  Select the instances (Linux nodes) you want to add, and click **Add to registered**. *** **Screenshot Add targets to target group TCP port 443**