Citrix ADC

Configure reverse proxy redirection

A reverse proxy resides in front of one or more Web servers and shields the origin server from client requests. Often, a reverse proxy cache is a front-end for all client requests to a server. An administrator assigns a reverse proxy cache to a specific origin server. This is unlike transparent and forward proxy caches, which cache frequently requested content for all requests to any origin server, and the choice of a server is based on the request.

Unlike a transparent proxy cache, the reverse proxy cache has its own IP address and can replace destination domains and URLs in a non-cacheable request with new destination domains and URLs.

You can deploy reverse proxy cache redirection at the origin-server side or at the edge of a network. When deployed at the origin server, the reverse proxy cache redirection virtual server is a front-end for all requests to the origin server.

In the reverse proxy mode, when the appliance receives a request, a cache redirection virtual server evaluates the request and forwards it to either a load balancing virtual server for the cache or a load balancing virtual server for the origin. The incoming request can be transformed by changing the host header or the host URL before they it is sent to the backend server.

To configure reverse proxy cache redirection, first enable cache redirection and load balancing. Then, configure a load balancing virtual server and services to send cacheable requests to the cache servers. Also configure a load balancing virtual server and associated services for the origin servers. Then, configure a reverse proxy cache redirection virtual server and bind relevant cache redirection policies to it. Finally, configure mapping policies and bind them to the reverse proxy cache redirection virtual server.

The mapping policies have an associated action that enables the cache redirection virtual server to forward any non-cacheable request to the load balancing virtual server for the origin.

Be sure to create the default cache server destination.

For details on how to enable cache redirection and load balancing on the appliance, seeEnable cache redirection and load balancing.

For details on how to create a load balancing virtual server, seeCreate a load balancing virtual server.

For details on how to configure services that represent the cache server, seeConfigure an HTTP service.

For details on how to bind the service to a virtual server, seeBind/unbind a service to/from a load balancing virtual server.

For details on how to create a reverse proxy cache redirection server, seeConfigure a cache redirection virtual server, and create a virtual server of type REVERSE.

For details on binding built-in cache redirection policies to the cache redirection virtual server, seeBind policies to the cache redirection virtual server.

Configure mapping policies

If an incoming request is non-cacheable, the reverse-proxy cache redirection virtual server replaces the domain and URL in the request with the domain and URL of a target origin server and forwards the request to the load balancing virtual server for the origin.

A mapping policy enables the reverse proxy cache redirection virtual server to replace the destination domain and URL and forward the request to the load balancing virtual server for the origin.

A mapping policy must first translate the domain and the URL, and then pass the request on to the origin load balancing virtual server.

政策可以映射域映射一个URL前缀,And a URL suffix, as follows:

  • Domain mapping: You can map a domain without a prefix or suffix. The domain mapping is the default mapping for the virtual server (for example, mapping www.mycompany.com to www.myrealcompany.com).
  • Prefix mapping: You can replace a specified pattern prefixed as part of the URL (for example, mapping www.mycompany.com/sports/index.html to www.mycompany.com/news/index.html).
  • Suffix mapping: You can replace the file suffix in the URL (for example, mapping www.mycompany.com/sports/index.html to www.mycompany.com/sports/index.asp).

The source and the destination strings being mapped must be similar. If you specify a source domain, you must specify a destination domain, and if you specify a source suffix, you must specify a destination suffix. Similarly, if you specify an exact URL from the source, the target URL must also be an exact URL.

Once you configure mapping policies for the reverse proxy mode, you must bind them to the cache redirection virtual server.

You can use combinations of the source URL, target URL, and source and target domains to configure all three types of domain mapping.

Configure a mapping policy for reverse proxy mode by using the CLI

At the command prompt, type the following command to add a policy map and verify the configuration:

- add policy map  -sd  [-su ] [-td ] [-tu ] - show policy map [] 

Example:

The following command maps a domain in a client request to a target domain:

> add policy map myMappingPolicy -sd www.mycompany.com -td www.myrealcompany.com Done > show policy map myMappingPolicy 1) Name: myMappingPolicy Source Domain: www.mycompany.com Source Url: Target Domain: www.myrealcompany.com Target Url: Done 

Following is an example of mapping a URL suffix to a different URL suffix:

> add policy map myOtherMappingPolicy -sd www.mycompany.com -td www.myrealcompany.com -su /news.html -tu /realnews.html Done > show policy map myOtherMappingPolicy 1) Name: myOtherMappingPolicy Source Domain: www.mycompany.com Source Url: /news.html Target Domain: www.myrealcompany.com Target Url: /realnews.html Done 

Configure a mapping policy for reverse proxy mode by using the GUI

  1. Navigate to Traffic Management > Cache Redirection > Map Policies.

  2. In the details pane, click Add.

  3. In the Create Map Policy dialog box, specify values for the following parameters as shown:

    • Name*- mapPolicyName
    • Source Domain*-sd
    • Target Domain*-td
    • Source URL-su
    • Target URL-tu

    *A required parameter

  4. Click Create, and then click Close. The Map pane displays the new mapping policy.

Bind the mapping policy to the cache redirection virtual server by using the CLI

At the command prompt, type the following commands to bind the mapping policy to the cache redirection virtual server and verify the configuration:

- bind cr vserver  -policyName  [] - show cr vserver  

Example:

>绑定cr vserver Vserver-CRD-3 -policyName myMappingPolicy Vserver-LB-CR Done > show cr vserver Vserver-CRD-3 Vserver-CRD-3 (10.102.29.50:88) - HTTP Type: CONTENT State: UP Client Idle Timeout: 180 sec Down state flush: ENABLED Disable Primary Vserver On Down : DISABLED Default: Vserver-LB-CR Content Precedence: RULE Cache: REVERSE On Policy Match: ORIGIN L2Conn: OFF OriginUSIP: OFF Redirect: POLICY Reuse: ON Via: ON ARP: OFF 1) Policy: Target: Vserver-LB-CR Priority: 0 Hits: 0 1) Map: myMappingPolicy Target: Vserver-LB-CR Done 

Bind the mapping policy to the cache redirection virtual server by using the GUI

  1. Navigate to Traffic Management > Cache Redirection > Virtual Servers.
  2. In the details pane, select the virtual server from which you want to bind the mapping policy, and then click Open.
  3. In the Configure Virtual Server(Cache Redirection), on the Policies tab, select Map, and then click Insert Policy.
  4. In the Policy Name column, select the policy from drop down list.
  5. In the Target column, click the down arrow, and then select the vserver from drop down list.
  6. Click OK.
Configure reverse proxy redirection

In this article