Note:

Configure the OCI Load Balancer to Access Multiple Instances using Different Domain Names

Introduction

In this tutorial, we will use the Oracle Cloud Infrastructure (OCI) Load Balancer in a Hub and Spoke network architecture to redirect network traffic to different backend sets (instances) based on URL or domain name.

image

Let us assume, we have dedicated our spoke VCNs to different customers or applications. We want to use one single load balancer to redirect traffic by the load balancer to these different customer instances inside the different spoke VCNs based URL that is used externally from the internet.

The following image illustrates the traffic flow when you use different URLs to access different instances or applications from the internet.

image

Objectives

Prerequisites

Task 1: Change the OCI Web Application Firewall (WAF) Policy

Change the WAF policy to allow traffic.

Task 2: Configure the Domain Name System (DNS) for the Public Domain Names

Use your DNS server to configure the domain names or hostnames or URLs and map them to the public IP address of the load balancer.

For this tutorial, the domain name that we are testing with is iwanhoogendoorn.nl. You will see the following mapping.

Name Type Value
customer-a A 144.xxx.xxx.xxx (Public IP address of the OCI Load Balancer)
customer-b A 144.xxx.xxx.xxx (Public IP address of the OCI Load Balancer)
customer-c A 144.xxx.xxx.xxx (Public IP address of the OCI Load Balancer)

This will create the following subdomains:

image

Task 3: Configure Hostnames OCI Load Balancer

Task 4: Create Multiple Backend Sets

Configure the backend sets for OCI Load Balancer.

Task 5: Create Multiple Listeners

Task 6: Test the Connectivity with the Different Public Domain Names

We have successfully tested the load balancer distributing the traffic based on a different URLs or hostnames.

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.