Define mapping rules
Mapping rules are configuration directives that cause client requests to Caching Proxy to
be processed in some way, for example, passed to an origin server (proxied),
redirected, or rejected. Setting mapping rules correctly is important to the
proper functioning of your Caching Proxy. Mapping rules affect the following:
- Basic proxy function
- Access to the browser-based Configuration and Administration forms
- Ability to cache servlet results and other dynamically generated content
Mapping rule directives use the following form:
rule template target [IP_address | host_name]:[port]
Only requests that match the given template and IP-port combination are
subject to that rule. A template can contain wildcards, for example, https://**/*.asp.
The order in which the rules appear in the configuration file is significant.
Except for Map directives, as soon as the request is matched to a template,
it is processed and subsequent rules are not evaluated. The Map directive
replaces the URL in the request. This new request continues to be compared
to the remaining mapping rules.
Mapping rules
The following mapping rules apply to client requests that match the given
template:
- Map, MapQuery -- rewrite the
request. The Map and MapQuery rules replace a request URL (template)
with another URL string (target). After this substitution, the request, containing
the new string, continues to be compared to the remaining mapping rules.
- RuleCaseSense -- allows mapping requests
from application URLs that are not case sensitive. When tuned off,
the RuleCaseSense directive allows the proxy to map requests against rules
defined in the ibmproxy.conf file without case sensitivity.
- Pass, Exec -- serve the request locally. The
Pass and Exec rules process the request at the proxy server. The Pass rule maps
a request URL (template) to a file that is served from the proxy server (target);
the Exec rule maps a request URL to a CGI program that runs on the proxy server.
- Fail -- reject the request. The Fail rule rejects
a request (template) at the proxy server. Any request that matches the template
of a Fail rule is not processed further. Fail rules do not have target arguments.
- Redirect -- forward the request. The Redirect
rule forwards a request (template) to another Web server (target). Because
a full URL, including the communication protocol, is the target of this rule,
it is possible to change the protocol during this redirection, for example,
to add SSL encryption to an HTTP request. A redirection does not check the
cache prior to satisfying the request.
- Proxy, ProxyWAS -- proxy the request. The Proxy
and ProxyWAS rules pass requests (templates) to another server (target). Unlike
a simple Redirect rule, the Proxy rules allow the proxy server to check the cache
to satisfy a request, to cache content from origin servers, and to write HTTP
headers that enable advanced functions. Use the ProxyWAS rule instead of the
Proxy rule when the origin server is a WebSphere Application Server.
The following mapping rule applies to the origin server response:
- ReversePass -- intercept automatically redirected
requests. A ReversePass rule matches the response from the origin server to
the template as it passes through the proxy server on its way to the client. The
ReversePass directive is designed to detect a redirection status code that
would cause a client to directly contact the origin server. The client is
instructed to contact the server defined in the target argument.
The following mapping rules apply to API applications:
- nameTrans -- accepts the request and runs an
API application, defined by the replacement file path, during the Name Translation
step of request processing.
- service -- accepts the request and runs an
API application, defined by the replacement file path, during the Service
step of request processing.
Configure a surrogate server
To configure a standard surrogate:
This allows all HTTP traffic on port 80 to be proxied to the origin server.
Traffic entering on the administration port does not match the initial wildcard
proxy rule, and so it is unaffected. The remaining mapping rules are used
to process the request.
Associated directives
The following directives define mapping rules:
For more information, refer to Manually editing the ibmproxy.conf file.
Configuration and Administration forms
The following Configuration and Administration form edits the values of the associated directives:
- Server Configuration -> Request Processing -> Request
Routing
Note:
The Configuration and Administration forms do not support the port number argument.
For more information, refer to Using the Configuration and Administration forms.