Real servers are dedicated physical servers that are typically configured in groups called server farms. These servers provide services to clients, such as HTTP or XML content, streaming media (video or audio), TFTP or FTP services, and so on. When configuring real servers, you assign names to them and specify IP addresses, connection limits, and weight values. The ACE appliance uses traffic classification maps (class maps) within policy maps to filter specified traffic and to apply specific actions to that traffic based on the load-balancing configuration. A load-balancing predictor algorithm (round-robin or least connections) determines the servers to which the ACE appliance sends connection requests. This document describes the configuration to use to configure a load balanced pair of real servers to use different port numbers based on request URL.
Basic understanding of working of Cisco ACE and familiarity with ACE CLI commands.
In case the real servers are not load balanced and they are using two different URL's, they would be resolving to two different VIPs. You can create two serverfarms with same servers but listening on ports 81 and 80 and create a class-map for different IP's or even same IP, listening on port 81 and 80. Any client coming with port 80 as destination would be loadbalanced to serverfarm_80 and any client coming on port 81 as destination would be loadbalanced to serverfarm_81.
class-map match-all Test_80 2 match virtual-address 10.1.1.1 tcp eq www
class-map match-all Test_81 3 match virtual-address 10.1.1.2 tcp eq 81
policy-map type loadbalance http first-match http class class-default serverfarm serverfarm_80
policy-map type loadbalance http first-match http_81 class class-default serverfarm serverfarm_81
policy-map multi-match Test class Test_80 loadbalance vip inservice loadbalance policy http loadbalance vip icmp-reply active class Test_81 loadbalance vip inservice loadbalance policy http_81 loadbalance vip icmp-reply active
If the real servers are load balanced and they answer for both URL's, but the destination port differs based on the URL, in this case basically we are redirecting any request which will come on second URL with port 80 to 81.
class-map match-all Test_81_redirect 4 match virtual-address 10.1.1.2 tcp eq www