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 NetScaler 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 NetScaler, see "Enabling Cache Redirection and Load Balancing."
For details on how to create a load balancing virtual server, see "Creating a Load Balancing Virtual Server."
For details on how to configure services that represent the cache server, see "Configuring an HTTP Service."
For details on how to bind the service to a virtual server, see "Binding/Unbinding a Service to/from a Load Balancing Virtual Server."
For details on how to create a reverse proxy cache redirection server, see "Configuring 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, see "Binding Policies to the Cache Redirection Virtual Server."
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.
A mapping policy can map a domain, a URL prefix, and a URL suffix, as follows:
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.
At the command prompt, type the following command to add a policy map and verify the configuration:
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 >
* A required parameter
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 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 >