Note:

Use the Public OCI Flexible Network Load Balancer to Expose your Webserver Pool to the Internet

Introduction

In this tutorial, we will describe how to set up three Oracle Cloud Infrastructure (OCI) instances that will act as a webserver. These webservers will all be connected to a private subnet and will be made reachable from the internet using an OCI Flexible Network Load Balancer. The network load balancer will not only make the websites available through the internet but will also balance the load of the incoming connections to these three OCI Compute instances.

image

image

Objectives

Task 1: Create a new Virtual Cloud Network (VCN)

We already have a VCN created but if you still need to create a new VCN, follow the tutorial: Create a New VCN with IPv6 Enabled.

Click the hamburger menu from the upper left corner. Click Virtual Cloud Networking to verify if the virtual cloud network exists.

image

Task 2: Create a new Public Subnet and Private Subnet

We already have a public and private subnet created but if you still need to create new subnets, follow the tutorials: Create a new Public Subnet with IPv6 Enabled and Create a Private Subnet inside the VCN.

We will connect OCI Compute instance to the public subnet and OCI Database to the private subnet.

Task 3: Create Three new OCI Compute Instances

We have three webservers with a private IP address assigned.

image

Webserver and website on instances

For this tutorial, we have deployed a custom image and this image already has a webserver with NGINX and PHP installed. If you select to deploy a new vanilla Oracle Linux image, you need to install NGINX with PHP and the custom webpage manually. This is required to test the network load balancer. If you do not have any custom image feel free to select the Oracle Linux 8 image.

Task 4: Create a new OCI Flexible Network Load Balancer

We have built the setup shown in the following image.

image

Task 5: Test the new OCI Network Load Balancer

Notice that all OCI Compute instances have OK health.

image

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.