Previous Topic: Sample Proxy Rules Configuration Files

Next Topic: Proxy Rules Example—Routing Requests by Header Value

Proxy Rules Example—Routing Requests by Virtual Host

The example file proxyrules_example1.xml file routes requests based on the hostname specified in the request.

In this file, a simple set of proxy rules routes user requests based on the virtual host specified in the requested resource. All requests to the bondtrading.company.com server are forwarded to server2, all requests to banking.company.com are forwarded to server1, and all other requests are forwarded to the companies home server, which is the default for requests that do not match the criteria in any other nete:cond element.

Note: The nete:case elements must specify a port, since the port number is considered as part of the virtual host requested by the user. Use the beginswith criteria to avoid needing port numbers.

The following table illustrates the results of requests using the proxy rules based on virtual hosts.

Requested URL

Forwarded URL

http://banking.company.com/index.html

http://server1.company.com/index.html

http://bondtrading.company.com/index.html

http://server2.company.com/index.html

http://www.company.com/index.html

http://home.company.com/index.html