132 Intel NetStructure Cache Appliance Administrator’s Guide
Understanding server acceleration mapping rules
Rewrite rules each consist of three space-delimited fields: type, target, and
replacement.
Type indicates the type of rule.
Target specifies the URL from which the request originates.
Replacement specifies the URL the appliance uses in place of the target
URL.
Using map
rules When the appliance receives a request as a server accelerator, it first constructs a
complete request URL from the relative URL and its headers. The appliance then
compares the complete request URL with its list of target (from) URL addresses,
looking for a match. For the request URL to match a target URL, the following
conditions must be true:
The scheme of both URL addresses must be the same.
The host in both URL addresses must be the same.
If the request URL contains an unqualified hostname, it will never match a
target URL with a fully qualified host name.
The ports in both URL addresses must be the same.
If no port is specified in a URL, the default port for the scheme of the URL is
used.
The path portion of the target URL must match a prefix of the request URL.
If the appliance finds a match, it translates the request URL into the replacement
URL in the rule. It sets the host and path of the request URL to match the
replacement URL. The appliance removes the prefix of the path that matched the
target URL and substitutes for it the path from the replacement URL.
Note Cross-scheme mappings are not permitted. For example, you cannot map HTTP
requests to FTP replacements.
Using
reverse-map
rules
Reverse mappings rewrite the location headers in origin server responses instead
of the headers in the user agent requests. Origin servers use location headers to
redirect clients to another location.
For example if there is a directory /pub on an origin server at
www.molasses.com, and a user agent sends the request to that server for /pub,
the server will probably reply with a redirect to http://www.test.com/pub/
to let the client know that it was a directory it had requested, instead of a
document. (A common use of redirects is to normalize URL addresses so that
clients can bookmark documents properly.)
The appliance uses reverse mappings to prevent redirects from origin servers
from causing clients to bypass the appliance in favor of direct access to the origin
servers.