Using Mapping Rules; To Create A Mapping Rule From Traffic Manager - HP P4535A - Web Cache Server Appliance Administrator's Manual

Hp cache server appliance administrator guide
Hide thumbs Also See for P4535A - Web Cache Server Appliance:
Table of Contents

Advertisement

Chapter 5

Using mapping rules

Traffic Server uses two types of mapping rules for HTTP reverse proxy:
A map rule translates the URL in client requests into the URL where the content is located (refer to "Map
rules," below)
A reverse-map rule translates the URL in origin server redirect responses to point to the Traffic Server so
that clients are redirected to Traffic Server instead of accessing an origin server directly (refer to "Reverse-
map rules," below)
Both map and reverse-map rules consist of a target (origin) URL and a replacement (destination) URL. In a
map rule, the target URL points to Traffic Server and the replacement URL specifies where the original
content is located. In a reverse-map rule, the target URL specifies where the original content is located and the
replacement URL points to Traffic Server. Traffic Server stores mapping rules in the
located in Traffic Server's
Map rules
When a Traffic Server in reverse proxy mode receives an HTTP client request, it first constructs a complete
request URL from the relative URL and its headers. Traffic Server then compares the complete request URL
with its list of target URLs in the
target URL, the following conditions must be true:
The scheme of both URLs must be the same
The host in both URLs must be the same (if the request URL contains an unqualified hostname, it will
never match a target URL with a fully qualified hostname)
The ports in both URLs 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 Traffic Server finds a match, it translates the request URL into the replacement URL listed in the map rule.
It sets the host and path of the request URL to match the replacement URL. If the URL contains path prefixes,
Traffic Server removes the prefix of the path that matches the target URL and substitutes it with the path from
the replacement URL.
If two mappings match a request URL, Traffic Server applies the first mapping listed in the
file.
Reverse-map rules
Reverse-map rules rewrite location headers in origin server responses, instead of client requests. Origin servers
use location headers to redirect clients to another location.
For example if there is a directory
request to that origin server for
www.test.com/pub/
(A common use of redirects is to normalize URLs so that clients can bookmark documents properly.)
Traffic Server uses reverse-map rules to prevent redirects from origin servers from causing clients to bypass
the Traffic Server in favor of direct access to the origin servers.
Setting map and reverse-map rules
You can set mapping rules by using Traffic Manager or by editing a configuration file manually. Both
procedures are described below.

To create a mapping rule from Traffic Manager:

1. Access Traffic Manager from your browser (refer to
2. On the Configure tab, click the Routing button.
directory.
config
file, looking for a match. For the request URL to match a
remap.config
on an origin server at
/pub
, the origin server will probably reply with a redirect to
/pub
to let the client know that it was a directory it had requested, instead of a document.
Reverse Proxy and HTTP Redirects
www.molasses.com
Accessing Traffic Manager‚ on page
file
remap.config
remap.config
, and a client sends a
http://
8).
36

Advertisement

Table of Contents
loading

This manual is also suitable for:

P4535a

Table of Contents