diff --git a/content/nginx/deployment-guides/amazon-web-services/high-availability-network-load-balancer.md b/content/nginx/deployment-guides/amazon-web-services/high-availability-network-load-balancer.md index dc2d6cbd0..9fcf9544f 100644 --- a/content/nginx/deployment-guides/amazon-web-services/high-availability-network-load-balancer.md +++ b/content/nginx/deployment-guides/amazon-web-services/high-availability-network-load-balancer.md @@ -9,29 +9,27 @@ toc: true weight: 100 --- -This guide explains how to create our recommended solution for a highly available, active‑active deployment of NGINX Plus in the Amazon Web Services (AWS) cloud. The solution combines the AWS Network Load Balancer (NLB) for fast and efficient handling of Layer 4 traffic with F5 NGINX Plus for advanced, Layer 7 features such as load balancing, caching, and content‑based routing. The combined solution is fast, powerful, reliable, and likely to be relatively low‑cost. +These instructions explain how to deploy F5 NGINX Plus in the Amazon Web Services (AWS) cloud. Use these instructions to create a highly available, active-active deployment with load balancing. -This guide explains how to set up an AWS NLB in front of one pair of NGINX Plus load balancers. (You can increase resiliency as needed by following the same steps for additional NGINX Plus instances.) +This solution combines the AWS Network Load Balancer (NLB) with NGINX Plus. In this solution, AWS NLB provides fast, efficient handling of Layer 4 traffic. NGINX Plus provides Layer 7 features such as load balancing, caching, and content-based routing. When combined, they form a fast, powerful, reliable, and relatively low-cost solution. -The [Appendix](#appendix) provides instructions for creating EC2 instances with the names used in this guide, and installing and configuring the NGINX software on them. +These instructions provide steps to set up an AWS NLB in front of one pair of NGINX Plus load balancers. Repeat these steps to install added NGINX Plus instances to increase resiliency, as needed. + +Refer to the [Appendix](#appendix) to create Amazon Elastic Compute Cloud (EC2) instances with names used in these instructions. There you can also find instructions to install and configure NGINX software on EC2. ## About AWS NLB -AWS NLB is optimized for fast, efficient load balancing at the connection level (Layer 4). AWS NLB uses a [flow hash routing algorithm](https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#routing-algorithm). - -AWS NLB is ideal for fast load balancing of TCP traffic, as it's able to handle millions of requests per second while maintaining ultra‑low latencies. This enables AWS NLB to more easily handle volatile traffic patterns – patterns with sudden and dramatic changes in the amount of traffic. - -Unlike previous AWS solutions, AWS NLB supports both static IP addresses and [Elastic IP addresses](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html). +AWS NLB uses a [flow hash routing algorithm](https://docs.aws.amazon.com/elasticloadbalancing/latest/userguide/how-elastic-load-balancing-works.html#routing-algorithm). It promotes fast, efficient load balancing at the connection level (Layer 4). This means that AWS NLB is ideal for fast load balancing of TCP traffic. It can handle millions of requests per second while maintaining ultra‑low latencies. As a result, AWS NLB easily handles traffic volume patterns that suddenly and dramatically change. AWS NLB supports both static IP addresses and [Elastic IP addresses](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html). This is a change from previous AWS solutions. ## About NGINX Plus -NGINX Plus is complementary to NLB. Operating at Layer 7 (the application layer), it uses more advanced load‑balancing criteria, including schemes that rely on the content of requests and the results of NGINX Plus' [active health checks]({{< relref "../../admin-guide/load-balancer/http-health-check.md" >}}). +[NGINX Plus](https://www.f5.com/products/nginx/nginx-plus) is the commercial version of [NGINX Open Source](http://nginx.org/en) software, which extends the power of NGINX with enterprise-ready capabilities. -[NGINX Plus](https://www.f5.com/products/nginx/nginx-plus) is the commercially supported version of the [NGINX Open Source](http://nginx.org/en) software. NGINX Plus is a complete application delivery platform, extending the power of NGINX with a host of enterprise‑ready capabilities that enhance an AWS web application deployment and are instrumental to building web applications at scale. +NGINX Plus complements AWS NLB. It operates at Layer 7 (the application layer) where it uses advanced criteria when load balancing. These criteria include schemes that rely on content of requests and the results of [active health checks]({{< ref "/nginx/admin-guide/load-balancer/http-health-check.md" >}}). -NGINX Plus provides both reverse‑proxy features and load‑balancing features, including: +NGINX Plus also provides reverse‑proxy and load balancing features, including: - [Full‑featured HTTP, TCP, and UDP load balancing](https://www.nginx.com/products/nginx/load-balancing/) - [Intelligent session persistence](https://www.nginx.com/products/nginx/load-balancing/#session-persistence) @@ -45,192 +43,214 @@ NGINX Plus provides both reverse‑proxy features and load‑balancing features ## Solution Overview -The setup in this guide combines AWS NLB, AWS target groups, Amazon Elastic Compute Cloud (EC2) instances running NGINX Plus, and EC2 instances running NGINX Open Source, which together provide a highly available, all‑active NGINX and NGINX Plus solution. +The combined solution described further in these instructions consists of: + +- AWS NLB +- AWS target groups +- EC2 instances running NGINX Plus +- EC2 instances running NGINX Open Source + +Together, these provide an HA, all-active NGINX and NGINX Plus solution. -AWS NLB handles Layer 4 TCP connections and balances traffic using a flow hash routing algorithm. By default, an AWS NLB has a DNS name to which an IP address is assigned dynamically, but you can optionally attach an Elastic IP address to the AWS NLB to ensure that it will always be reachable at the same IP address. +AWS NLB uses a flow hash routing algorithm to balance traffic and handle Layer 4 TCP connections. AWS NLB listens for incoming connections as defined by its listeners. Each listener forwards a new connection to one of the available instances in a target group. AWS NLB uses the flow hash routing algorithm to chose an available instance. -The AWS NLB listens for incoming connections as defined by its listeners. Each listener forwards a new connection to one of the available instances in a target group, chosen using the flow hash routing algorithm. +{{< note >}} By default, an AWS NLB uses a DNS name with a dynamic IP address. As an option, you can attach an Elastic IP address to the AWS NLB. This ensures that the AWS NLB is always reachable at the same IP address. {{< /note >}} -In this guide, the target group consists of two NGINX Plus load balancer instances. However, you can register an unlimited number of instances in the target group, or use an [AWS Auto Scaling group](https://aws.amazon.com/autoscaling/) to dynamically adjust the number of NGINX Plus instances. +These instructions assume a target group consists of two NGINX Plus load balancer instances. You can register an unlimited number of instances in the target group. Or, you can use an [AWS Auto Scaling group](https://aws.amazon.com/autoscaling/) to dynamically adjust the number of NGINX Plus instances. ## Prerequisites These instructions assume you have the following: +- Familiarity with NGINX and NGINX Plus configuration syntax. - [An AWS account](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/AboutAWSAccounts.html). -- Six EC2 instances, four running NGINX Open Source and two running NGINX Plus. You need a subscription for each NGINX Plus instance, either paid or a [30‑day free trial](https://www.nginx.com/free-trial-request). - - The [Appendix](#appendix) provides instructions for creating instances with the expected names, and installing and configuring the NGINX software. - -- Familiarity with NGINX and NGINX Plus configuration syntax. Complete configuration snippets are provided, but not analyzed in detail. +- Six EC2 instances running a version of NGINX: + - Four running NGINX Open Source + - Two running NGINX Plus + - You need a subscription for each NGINX Plus instance, either paid or a [30‑day free trial](https://www.nginx.com/free-trial-request). + Refer to the [Appendix](#appendix) to create EC2 instances with names used in these instructions. There you can also find instructions to install and configure NGINX software on EC2. -## Configuring an AWS Network Load Balancer +## Configure an AWS Network Load Balancer + +Once you install and configure NGINX Open Source and NGINX Plus on the EC2 instances you are ready to set up AWS NLB. Refer to the [Appendix](#appendix) for more installation and set up instructions. -With NGINX Open Source and NGINX Plus installed and configured on the EC2 instances (see the [Appendix](#appendix)), we’re ready to configure an AWS NLB for a highly available, all‑active NGINX Plus setup. +The steps to set up an AWS NLB for an HA, all‑active NGINX Plus deployment include: -- [Allocating an Elastic IP Address](#nlb-eip) -- [Creating an AWS NLB](#nlb-create) -- [Configuring the AWS NLB Routing Options](#nlb-routing-options) -- [Registering Instances in the Target Group](#nlb-register-instances) -- [Launching the AWS NLB](#nlb-launch) +- [Allocate an Elastic IP Address](#nlb-eip) +- [Create an AWS NLB](#nlb-create) +- [Configure the AWS NLB Routing Options](#nlb-routing-options) +- [Register Instances in the Target Group](#nlb-register-instances) +- [Launch the AWS NLB](#nlb-launch) -### Allocating an Elastic IP Address +### Allocate an Elastic IP Address -The first step is to allocate an Elastic IP address, which becomes the fixed IP address for your AWS NLB. (While using an Elastic IP address is optional, we strongly recommend that you do so. With a dynamic IP address, the AWS NLB might not remain reachable if you reconfigure or restart it.) +The first step is to allocate an Elastic IP address, which becomes the fixed IP address for your AWS NLB. Using an Elastic IP address is optional, but it is strongly recommended that you do so. With a dynamic IP address, the AWS NLB might not remain reachable if you reconfigure or restart it. 1. Log in to the [AWS Management Console](https://console.aws.amazon.com/ec2/) for EC2 (****). -2. In the left navigation bar, select **Elastic IPs**, then click either of the  Allocate new address  buttons. +2. In the navigation bar, select **Elastic IPs**. Then, select either of the *Allocate new address* buttons. -3. In the **Allocate new address** window that opens, click the  Allocate  button. +3. The **Allocate new address** window opens. Select the *Allocate* button. -4. When the message appears indicating that the request for an Elastic IP address succeeded, click the  Close  button. +4. A message displays that the request for an Elastic IP address succeeded. Select the *Close* button. -The new Elastic IP address appears on the **Elastic IPs** dashboard. +The new Elastic IP address displays on the **Elastic IPs** dashboard. Make a note of this address, you will use it in the next step. -### Creating the AWS NLB +### Create the AWS NLB -1. In the left navigation bar, select **Load Balancers**, then click the  Create Load Balancer  button. +1. In the navigation bar, select **Load Balancers**. Then, select the *Create Load Balancer* button. -2. In the **Select load balancer type** window that opens, click the  Create  button in the  Network Load Balancer  panel (the center one). +2. The **Select load balancer type** window opens. Select the *Create* button in the center *Network Load Balancer* panel. -3. In the **Step 1: Configure Load Balancer** window that opens, enter the following values: +3. The **Step 1: Configure Load Balancer** window that opens. Use the following values to set up the load balancer: - In the **Basic Configuration** section: - - **Name** – Name of your AWS NLB (aws-nlb-lb in this guide). - - **Scheme** – internet-facing. + - **Name** – Enter the name of your AWS NLB (*aws-nlb-lb* in these instructions). + - **Scheme** – Select *internet-facing*. - In the **Listeners** section: - - **Load Balancer Protocol** – TCP (the only available option). - - **Load Balancer Port** – Port on which your AWS NLB listens for incoming connections. In this guide, and for most web applications, it is port 80. - - In the **Availability Zones** section, the zones that host the EC2 instances to which your AWS NLB routes traffic. Click the radio button in the leftmost column of the appropriate row: - - If you set up your instances with the instructions in [Creating Amazon EC2 Instances for NGINX Open Source and NGINX Plus]({{< relref "ec2-instances-for-nginx.md" >}}), select the default subnet within the default [Amazon Virtual Private Cloud](https://aws.amazon.com/vpc/) (VPC) to target a single availability zone. - - If you set up your instances using our scripts for [Packer and Terraform](#create-instances-automated), use the aws-nlb-subnet within the aws-nlb-vpc VPC to target a single availability zone. + - **Load Balancer Protocol** – Select *TCP* (the only available option). + - **Load Balancer Port** – Enter *80*. This is the port on which your AWS NLB listens for incoming connections. + - In the **Availability Zones** section, designate the zones that host EC2 instances where your AWS NLB routes traffic. Both options target a single availability zone. Choose the option that matches the method used to set up EC2 instances. In the table, select the button in the row you want to choose: + - If you used [Creating Amazon EC2 Instances for NGINX Open Source and NGINX Plus]({{< ref "/nginx/deployment-guides/amazon-web-services/ec2-instances-for-nginx.md" >}}), select the default subnet within the default [Amazon Virtual Private Cloud](https://aws.amazon.com/vpc/) (VPC). + - If you used our scripts for [Packer and Terraform](#create-instances-automated), select the *aws-nlb-subnet* within the *aws-nlb-vpc* VPC. -4. When you select an availability zone in the table, a drop‑down menu appears in the **Elastic IP** column. Select the address you allocated in [Allocating an Elastic IP Address](#nlb-eip). +4. When you select an availability zone in the table, a drop‑down menu displays in the **Elastic IP** column. Select the address you allocated in [Allocate an Elastic IP Address](#nlb-eip). -5. Click the  Next: Configure Routing  button in the lower‑right corner of the window. +5. Select the *Next: Configure Routing* button. The **Step 2: Configure Routing** window opens. -### Configuring the AWS NLB Routing Options +### Configure the AWS NLB Routing Options -In the **Step 2: Configure Routing** window that opens, you create a _target group_, which contains the set of EC2 instances across which your AWS NLB load balances traffic (you'll specify those instances in [Registering Instances in the Target Group](#nlb-register-instances)). +In this step, you create a _target group_, using the **Step 2: Configure Routing** window. The target group contains the set of EC2 instances across which your AWS NLB load balances traffic. You specify those EC2 instances later, in the step [Register Instances in the Target Group](#nlb-register-instances)). -1. In the **Target group** section, select or enter the following values: +1. In the **Target group** section, use the following values to create the target group: - - **Target group** – New target group - - **Name** – Name of the target group (for this guide, aws-nlb-tg) - - **Protocol** – TCP (the only available option) - - **Port** – The port you specified for the **Load Balancer Port** field in Step 3 of the [previous section](#nlb-create) (80 in this guide) - - **Target type** – instance + - **Target group** – Select *New target group* + - **Name** – Enter the name of the new target group. For these instructions use *aws-nlb-tg* + - **Protocol** – Select *TCP* (the only available option) + - **Port** – Enter *80*. This is the same value you specified for the **Load Balancer Port** field in Step 3 of the [previous section](#nlb-create). + - **Target type** – Enter *instance* 2. In the **Health checks** section, open the **Advanced health check settings** subsection and enter the following values: - - **Protocol** – Protocol the AWS NLB uses when sending health checks. This guide uses TCP, which means the AWS NLB makes a health check by attempting to open a TCP connection on the port specified in the next field. - - **Port** – Port on the target instances to which the AWS NLB sends health checks. In this guide, we're selecting traffic port to send health checks to the same port as regular traffic. - - **Healthy threshold** – Number of consecutive health checks an unhealthy instance must pass to be considered healthy. - - **Unhealthy threshold** – Number of consecutive health checks a healthy instance must fail to be considered unhealthy. - - **Timeout** – Number of seconds the AWS NLB waits for a response to the health check before considering the instance unhealthy. - - **Interval** – Number of seconds between health checks. + - **Protocol** – Enter either *HTTP*, or *HTTPS*, as described below. This field specifies the protocol the AWS NLB uses when sending health checks. + - **TCP** - AWS NLB attempts to open a TCP connection to send a health check. The port it uses is specified in the next field. If you select TCP you must also define **Port**. + - **Port** – Select *traffic port*. This is the port on the target instances to which the AWS NLB sends health checks. These instructions use **traffic port** to send health checks to the same port as regular traffic. This value is required if the value for **Protocol** is **TCP**. + - **HTTP** or **HTTPS** AWS NLB sends a GET request to send a health check. The path it uses is specified in the next field. If you select **HTTP** or **HTTPS** you must also define **Path** and **Success codes** as follows: + - **Path** – Enter the path to which the AWS NLB sends a `GET` request as the health check. This value is required if the value for **Protocol** is **HTTP** or **HTTPS**. + - **Success codes** – Enter the range of HTTP response codes the AWS NLB should accept to show a successful health check. This value is required if the value for **Protocol** is **HTTP** or **HTTPS**. + - **Healthy threshold** – Enter a whole number. This is the number of consecutive health checks an unhealthy instance must pass to be considered healthy. + - **Unhealthy threshold** – Enter a whole number. This is the number of consecutive health checks a healthy instance must fail to change its status to unhealthy. + - **Timeout** – Enter the number of seconds the AWS NLB waits for a response to the health check before considering the instance unhealthy. + - **Interval** – Enter the number of seconds between health checks. - If you want to use HTTP‑based health checks, select HTTP or HTTPS in the **Protocol** field instead of TCP. Two additional fields open (not shown in the screenshot): - - - **Path** – The path to which the AWS NLB sends a `GET` request as the health check. - - - **Success codes** – Range of HTTP response codes the AWS NLB accepts as indicating a successful health check. - -3. Click the  Next: Register Targets  button in the lower‑right corner of the window. +3. Select the *Next: Register Targets* button. The **Step 3: Register Targets** window opens. -### Registering Instances in the Target Group +### Register Instances in the Target Group -In the **Step 3: Register Targets** window that opens, you add instances to the empty target group you created in the previous section. For this guide, we add both of our NGINX Plus load balancer instances. +In this step, you add instances to the empty target group you created in the previous section. Use the the **Step 3: Register Targets** window to add both NGINX Plus load balancer instances. -1. In the **Instances** table, click the radio button in the left‑most column for the two NGINX Plus load balancer instances, ngx-plus-1 and nginx-plus-2. +1. In the **Instances** table, select the buttons for both NGINX Plus load balancer instances. Select the instance names *ngx-plus-1* and *nginx-plus-2*. -2. Click the  Add to registered  button above the table. The instances are added to the **Registered targets** table. +2. Select the *Add to registered* button above the table. The instances are added to the **Registered targets** table. -3. Click the  Next: Review  button in the lower‑right corner of the window. +3. Select the *Next: Review* button. The **Step 4: Review** window opens. -### Launching the AWS NLB +### Launch the AWS NLB -In the **Step 4: Review** window that opens: +In this step you use the **Step 4: Review** window to verify settings and launch AWS NLB. -1. Verify that the settings are correct. If so, click the  Create  button in the lower‑right corner of the window. To change settings, click the  Previous  button to go back to previous screens. +1. In the **Step 4: Review** window verify that the settings are correct. + - If so, select the  Create  button. + - If the settings are not correct, select the *Previous* button to go back to a previous screen. Make required change(s) on previous screen(s). Then, return to the **Step 4: Review** window to select *Create*. -2. The AWS NLB is provisioned. When the success message appears, click the  Close  button to return to the **Load Balancers** dashboard. + The *Create* action provisions the AWS NLB. A success message displays when the provisioning operation finishes. It can take a few minutes to provision the AWS NLB. - +2. Select the *Close* button to return to the **Load Balancers** dashboard. -3. The **Load Balancers** dashboard opens. As noted in the previous **Load Balancer Creation Status** window, it can take a few minutes to provision the AWS NLB. When the value in the **State** column of the table changes to active, click the radio button in the left‑most column to display details about the AWS NLB. + +3. Observe the values in the **State** column of the table. When a value changes to *active*, you can display details about the provisioned AWS NLB. Select the button in an AWS NLB row to display its details. + -4. To verify that the AWS NLB is working correctly, open a new browser window and navigate to the AWS NLB's public DNS name, which appears in the **DNS name** field in the **Basic Configuration** section of the dashboard. [If you copy and paste the DNS name, be sure not to include the parenthesized words at the end, (A Record).] +4. Next, verify that the AWS NLB is working. Open a new browser window and navigate to the AWS NLB's public DNS name. You can find the **DNS name** field in the **Basic Configuration** section of the **Load Balancers** dashboard. **Note:** If you copy and paste the DNS name, be sure to exclude the parenthesized words at the end, for example, *(A Record)*. - The default **Welcome to nginx!** page indicates that the AWS NLB has successfully forwarded a request to one of the two NGINX Plus instances. + If you see the **Welcome to nginx!** page then the AWS NLB successfully forwarded a request to one of the two NGINX Plus instances. -5. To verify that the NGINX Plus load balancer is working correctly, add /backend-one and then /backend-two to the public DNS name. The pages indicate that you have reached NGINX instances serving the two backend applications, App 1 and App 2. +5. Last, verify that the NGINX Plus load balancer can reach backend applications. + + - Append */backend-one* to the public DNS name in the open browser window. If *App 1* is displayed then you have reached the **App 1** NGINX backend instance. + - Append */backend-two* to the public DNS name in the open browser window. If *App 2* is displayed then you have reached the **App 2** NGINX backend instance. + +Congratulations! You deployed NGNX Plus in the AWS cloud and created a highly available, active-active deployment with load balancing. + ## Appendix -This Appendix provides links to instructions for creating EC2 instances with the names used in this guide, and then installing and configuring NGINX Open Source and NGINX Plus on them: +Use links in this appendix to create EC2 instances with names used in the above instructions. Then, use steps below to install and configure NGINX Open Source and NGINX Plus on those instances. -- [Creating EC2 Instances and Installing the NGINX Software](#create-instance-install-nginx) -- [Configuring NGINX Open Source on the Web Servers](#configure-web-servers) -- [Configuring NGINX Plus on the Load Balancers](#configure-load-balancers) +You can either complete these individual steps: -As an alternative to creating and configuring instances individually, you can use our Packer and Terraform scripts to completely automate the process: +- [Create EC2 Instances and Install the NGINX Software](#create-instance-install-nginx) +- [Configure NGINX Open Source on the Web Servers](#configure-web-servers) +- [Configure NGINX Plus on the Load Balancers](#configure-load-balancers) -- [Automating Instance Setup with Packer and Terraform](#create-instances-automated) +OR -After completing the instructions, you have completed the prerequisites for this guide and can continue to [Configuring an AWS Network Load Balancer](#nlb-configure). +Use our Packer and Terraform scripts to completely automate the process: + +- [Automate Instance Setup with Packer and Terraform](#create-instances-automated) + +Once you have created and configured the EC2 instances, your prerequisites are complete. Continue to [Configure an AWS Network Load Balancer](#nlb-configure). -### Creating EC2 Instances and Installing the NGINX Software +#### Create EC2 Instances and Install the NGINX Software -The deployment in this guide uses six EC2 instances: two instances running NGINX Plus that load balance traffic to four instances running NGINX Open Source as a web server. The four NGINX Open Source instances are deployed in two pairs, each pair running a different app. +The deployed solution in these instructions uses six EC2 instances. Two instances run NGINX Plus. These load balance traffic to the other four instances, which run NGINX Open Source as a web server. The four NGINX Open Source instances deploy in two pairs; each pair runs a different app. -Step‑by‑step instructions for creating EC2 instances and installing NGINX Open Source and NGINX Plus are provided in our deployment guide, [Creating Amazon EC2 Instances for NGINX Open Source and NGINX Plus]({{< relref "ec2-instances-for-nginx.md" >}}). +*Step‑by‑step* instructions for creating EC2 instances and installing NGINX Open Source and NGINX Plus are available. Refer to our deployment guide, [Creating Amazon EC2 Instances for NGINX Open Source and NGINX Plus]({{< ref "/nginx/deployment-guides/amazon-web-services/ec2-instances-for-nginx.md" >}}). -**Note:** When installing NGINX Open Source or NGINX Plus, you connect to each instance over SSH. To save time, leave the SSH connection to each instance open after installing the software, for reuse when you configure it with the instructions in the sections below. +{{< note >}} When installing NGINX Open Source or NGINX Plus, you connect to each instance over SSH. To save time, leave the SSH connection to each instance open after installing the software. This way, you can reuse the connection when configuring the instance. {{< note >}} -Assign the following names to the instances, and then install the indicated NGINX software. The screenshot below shows the resulting **Instances** table. +Assign the following names to the instances, then install the indicated NGINX software. The screenshot below shows the resulting **Instances** table. - Four NGINX Open Source instances: - App 1: @@ -247,13 +267,13 @@ Assign the following names to the instances, and then install the indicated NGIN -### Configuring NGINX Open Source on the Web Servers +#### Configure NGINX Open Source on the Web Servers -For the purposes of this guide, you configure the NGINX Open Source instances as web servers that return a page specifying the server name, address, and other information. As an example, here's the page returned by App 1: +Configure NGINX Open Source instances as web servers. These should return a page specifying the server name, address, and other information. As an example, here's the page returned by *App 1*: -Step‑by‑step instructions are provided in our deployment guide, Setting Up an NGINX Demo Environment. +Use the *Step‑by‑step* instructions in our deployment guide, [Setting Up an NGINX Demo Environment]({{< ref "/nginx/deployment-guides/setting-up-nginx-demo-environment.md" >}}). Repeat the instructions on all four web servers: @@ -265,22 +285,25 @@ Repeat the instructions on all four web servers: - ngx-oss-app2-2 -### Configuring NGINX Plus on the Load Balancers +#### Configure NGINX Plus on the Load Balancers -For the purposes of this guide, you configure the NGINX Plus instances as load balancers to distribute requests to the NGINX Open Source web servers set up in [Configuring NGINX Open Source on the Web Servers](#configure-web-servers). +Configure NGINX Plus instances as load balancers. These distribute requests to NGINX Open Source web servers set up in [Configure NGINX Open Source on the Web Servers](#configure-web-servers). -Step‑by‑step instructions are provided in our deployment guide, Setting Up an NGINX Demo Environment. +Use the *Step‑by‑step* instructions in our deployment guide, [Setting Up an NGINX Demo Environment]({{< ref "/nginx/deployment-guides/setting-up-nginx-demo-environment.md" >}}). Repeat the instructions on both ngx-plus-1 and ngx-plus-2. -## Automating Instance Setup with Packer and Terraform +### Automate Instance Setup with Packer and Terraform + +You can automate set up of the six instances described in these instructions. Automation is an alternative to creating and configuring each instance one at a time. To automate the set up, use the Packer and Terraform scripts from our [GitHub repository](https://github.com/nginxinc/NGINX-Demos/tree/master/aws-nlb-ha-asg). These scripts will: -As an alternative to individual creation and configuration of the six instances used in this guide, you can use the Packer and Terraform scripts from our [GitHub repository](https://github.com/nginxinc/NGINX-Demos/tree/master/aws-nlb-ha-asg). They generate the complete setup for this guide, with two load balancer instances running NGINX Plus and four web server instances running NGINX Open Source. +- Configure two load balancer instances running NGINX Plus +- Configure four web server instances running NGINX Open Source -After executing the scripts, you can jump directly into the [instructions for creating an AWS NLB](#nlb-configure) without any further setup. Additionally, the scripts create a new set of networking rules and security group settings to avoid conflicts with any pre‑existing network settings. +These scripts also create a new set of networking rules and security group settings. These rules and settings help avoid conflicts with any pre‑existing network settings. After you run the scripts, continue to the [instructions for creating an AWS NLB](#nlb-configure). No further setup is required. -**Note:** Instead of using the default VPC like the [instructions in our Deployment Guide]({{< relref "ec2-instances-for-nginx.md" >}}), the scripts create a new VPC. +{{< note >}} These scripts also create a new VPC. They do not use the default VPC described in the [instructions in our Deployment Guide]({{< ref "/nginx/deployment-guides/amazon-web-services/ec2-instances-for-nginx.md >}}). {{< /note >}} To run the scripts, follow these instructions: @@ -288,9 +311,9 @@ To run the scripts, follow these instructions: 2. Clone or download the scripts from our [GitHub repository](https://github.com/nginxinc/NGINX-Demos/tree/master/aws-nlb-ha-asg): - - The scripts in packer/ngx-oss are for creating an Ubuntu AMI running open source NGINX. - - The scripts in packer/ngx-plus are for creating an AWS Linux AMI running NGINX Plus. - - The scripts in **terraform** are for launching and configuring the two NGINX Plus load balancer instances and the four NGINX Open Source web server instances. + - Use the scripts in **packer/ngx-oss** to create an Ubuntu AMI running NGINX Open Source. + - Use the scripts in **packer/ngx-plus** to create an AWS Linux AMI running NGINX Plus. + - Use the scripts in **terraform** to launch and configure the two NGINX Plus load balancer instances and the four NGINX Open Source web server instances. 3. Set your AWS credentials in the Packer and Terraform scripts: @@ -323,20 +346,14 @@ To run the scripts, follow these instructions: ./setup.sh ``` -The script launches two NGINX Plus load balancer instances and four NGINX web server instances and configures the appropriate settings on each instance to run the guide. +When run, this script: +- Launches two NGINX Plus load balancer instances and four NGINX web server instances +- Configures the appropriate settings on each instance to run the guide -If you want to delete the infrastructure created by Terraform, run the `cleanup.sh` script. +6. **Optional:** To delete the infrastructure created by Terraform, run the `cleanup.sh` script. ```shell chmod +x cleanup.sh ./cleanup.sh ``` -### Revision History - -- Version 5 (March 2020) – Fix link missed in Version 4 -- Version 4 (November 2019) – Change link to GitHub repo for automated setup -- Version 3 (April 2019) – Modularization of Appendix -- Version 2 (April 2018) – Revisions to Appendix -- Version 1 (November 2017) – Initial version (NGINX Plus Release 13) -