Technical Tip: Setting up a VIP load-balance with HTTP-host check in HTTP header
Description
This article describes a basic scenario for configuring a VIP load-balance with an HTTP-header check, also known as a reverse proxy.
This helps set up a scenario where the Public IP is mapped to different real servers based on the request in the HTTP header (URL accessed by the customer).
Scope
FortiGate.
Note the following prerequisites for a VIP load-balance:
- FortiGate must be operating in Profile-based mode.
- The firewall policy for the specific traffic must be in proxy inspection mode.
- If the intended mode is HTTPS, then the hardware must support SSL offloading.
Focus on the following specific scenario:

edit " Vserver-HTTPS-LB"
set type server-load-balance
set extip 123.45.67.89
set extintf "wan1"
set server-type https
set ldb-method http-host
set extport 45678
config realservers
edit 1
set ip 192.168.1.1
set port 443
set http-host "test1.clientdomain.com"
next
edit 2
set ip 192.168.1.2
set port 443
set http-host "test2.clientdomain.com"
next
edit 3
set ip 192.168.1.3
set port 443
set http-host "test3.clientdomain.com"
next
end
set ssl-mode full
set ssl-certificate "clientdomain_certificate"
next
end
edit 0
set name "VIP-LB-policy"
set inspection-mode proxy
set srcintf "wan1"
set dstintf "internal"
set srcaddr "all"
set dstaddr "Vserver-HTTPS-LB"
set action accept
set schedule "always"
set service "ALL"
next
end
- Before v6.2: all the real servers must be on the same subnet.
v6.2 and newer: The real servers may be on different subnets, as long as (s)NAT is disabled on the firewall policy (set nat disable). - It is important to note that there is a limitation on the number of real servers that can be configured under every VIP check for the platform and FortiOS version used, by using the command 'print tablesize' or checking the Maximum Values Table portal. Look for the parameter 'firewall.vip:realservers', which will show how many real servers can be configured for every VIP object. For example, for 100E and FortiOS 7.2.4, the value for 'firewall.vip:realservers' is 16, which means 16 real servers for every VIP can be configured.
This scenario is not possible before v6.2:

- In the left panel option, go to System -> Feature Visibility.

- In the column 'Additional Feature', search for 'Load Balance'.

- Once enabled, under the section 'Policy and Objects', the new feature is seen as 'Virtual Servers'.

- Select to create a new Virtual Server to see the previously mentioned options.

Technical Tip: Active-Standby Virtual Servers (Server Load balancing)
Technical Note: How to configure Load Balance VIP using health monitor in SLBC environment
Technical Tip: Changing the inspection mode of the firewall
Proxy-related features not supported on FortiGate 2 GB RAM models
