Edge Load Balancing by URI

Edge Load Balancer is actually a HAProxy and supports different ways of balancing traffic between servers. Among them, balancing HTTP requests by URI, the web address of the page, which we will consider in this article.

This way of balancing is used when you need to separate "heavy" requests from the rest of the traffic and redirect it to a separate pool of servers.

Test Infrastructure

To demonstrate this balancing method, we deployed three virtual machines in a separate vApp: web1, web2, web3.

web2 in our case will handle heavy traffic, and web1 and web3 will handle all other traffic.

Temporary fw and dnat rules were added to debug and test the web servers.

Firewall - traffic to the external IP on ports 80 to 83 is allowed.

NAT - each port is redirected to its own server

As web servers nginx was used, in addition to the home page two more pages light.html and heavy.html were added.

The configurations of the virtual machines and web servers are identical.

The differences are the hostnames, internal IP addresses, and the web pages themselves: the header for clarity shows the hostname of the webserver.

 

 

Load Balancer configuration

Global Configuration

Enabling balancing

Application Profiles

Add the application profile to be used by the virtual server.

 

 

Service Monitoring

Add monitoring of web servers. This is not required, but will allow you to monitor performance and use only "live" pool servers.

Monitor or None is selected in the next step.

 

Pools

Add two pools of servers: for "heavy" traffic and for all other traffic

 

Application Rules

Add a rule that will allow the balancer to distribute traffic into pools depending on URIs:

acl site_heavy path_beg -i /heavy
use_backend pool-web2 if site_heavy

Pages with /heavy addresses will be handed over to pool-web2 pool servers.

There can be more rules than the virtual server uses.

Virtual Servers

Add a Virtual Server. On the General tab enable it, select the application profile, external IP address, protocol, and default pool.

On the Advanced tab, select the previously defined application rules.

The result is the following settings:

Checking

Homepage

Clicking on the light link

Click on the heavy-link

URI balancing now works, setup is complete.

 

Examples of different rules you can find in the official documentation.

  • Edge, Load Balancer, Balance by URI
  • 50 Users Found This Useful
Was this answer helpful?

Related Articles

Hairpin NAT on the Edge Gateway

Hairpin NAT can be used to access a host behind a NAT while also being behind that same NAT....

Diagnosing Network Connections on an EDGE Virtual Router (Part 1)

Sometimes you may have problems configuring the virtual router when port forwarding is not...

Diagnostics of network connections on a virtual EDGE router (Part 2)

In this article, we will consider the possibility of capturing network packets on EDGE with its...

Load balancing with advanced edge

A load balancer built into the advanced edge accepts UDP, TCP, HTTP, HTTPS requests and...

Network configuration of VMware infrastructure (NAT, DHCP, Firewall, Static Routing, VPN)

Network configuration of VMware infrastructure (NAT, DHCP, Firewall, Static Routing, VPN)....