Defining your web servers & load balancers : Defining your web servers : Creating a server pool : Example: Routing according to the HTTP “Host:” field
 
Example: Routing according to the HTTP “Host:” field
Your FortiWeb appliance might have one virtual server (the front end) protecting three physical web servers (the back end).
From the perspective of clients connecting to the front end, Example Company’s web site has a few domain names:
http://www.example.com
http://www.example.cn
http://www.example.de
http://www.example.co.jp
Public DNS resolves all of these domain names to one IP address: the virtual server on FortiWeb.
At the data center, behind the FortiWeb, separate physical web servers host some region-specific web sites. Other web sites have lighter traffic and are maintained by the same person, and therefore a shared server hosts them. Each back-end web server has a DNS alias. When you configure the server pools, you define each pool member using its DNS alias, rather than its IP address:
www1.example.com — Hosts www.example.com, plus all other host names’ content, in case the other web servers fail or have scheduled down time
www2.example.com — Hosts www.example.de
www3.example.com — Hosts www.example.cn & www.example.co.jp
While public DNS servers all resolve these aliases to the same IP address — FortiWeb’s virtual server — your private DNS server resolves these DNS names to separate IPs on your private network: the back-end web servers.
www1.example.com — Resolves to 192.168.0.1
www2.example.com — Resolves to 192.168.0.2
www3.example.com — Resolves to 192.168.0.3
In this case, you configure HTTP content routing to route requests from clients based on the original Host: field in the HTTP header to a server pool that contains the appropriate DNS aliases. The destination back-end web server is determined at request time using server health check statuses, as well as private network DNS that resolves the DNS alias into its current private network IP address:
http://www.example.com/ — Routes to a pool that contains www1.example.com
http://www.example.de/ — Routes to a pool that contains members www2.example.com and www1.example.com. The www2.example.com pool member is first in the list and receives requests unless that web server is down, in which case FortiWeb routes requests to www1.example.com
http://www.example.cn/ & http://www.example.co.jp/ — Routes to a pool that contains members www3.example.com and www1.example.com. The www3.example.com pool member is first in the list and receives requests unless that web server is down, in which case FortiWeb routes requests to www1.example.com
If you need to maintain HTTP session continuity for web applications, ensure the pool have a persistence policy that forwards subsequent requests from a client to the same back-end web server as the initial request.
See also
Routing based on HTTP header content, source IP, or cookie
Rewriting & redirecting
Creating a server pool
Configuring server up/down checks