*Back to [[Book|Administrator's Configuration File Reference#cfr]] [[Topic|Administrator's Configuration File Reference#chap7]]*
h2. {{Route}} {anchor:rout}
The {{Route}} directive specifies information as to where the Web Server should route requests. For more information, see [{{Route}}|Flow of Control in obj.conf#route].
The following {{Route}}-class functions are described in detail in this section:
* [#{{set-origin-server}}]
* [#{{set-proxy-server}}]
In addition, the following common SAFs are valid for the Route directive:
* [{{match-browser}}|Common SAFs across Multiple Directives#saf2]
* [{{set-variable}}|Common SAFs across Multiple Directives#saf8]
h3. {{set-origin-server}} {anchor:rout1}
The {{set-origin-server}} function distributes the load across a set of homogeneous HTTP origin servers.
h4. Parameters
The following table describes parameters for the {{set-origin-server}} function.
Table 7-77 {{set-origin-server}} Parameters
||Parameter ||Description ||
|{{server}} |URL of the origin server. If multiple server parameters are given, the server distributes the load among the specified origin servers. |
|{{sticky-cookie}} |(Optional) Name of a cookie that, when present in a response, will cause subsequent requests to stick to that origin server. The default value is {{JSESSIONID}}. |
|{{sticky-param}} |(Optional) Name of a URI parameter to inspect for route information. When the URI parameter is present in a request URI and its value contains a colon ( : ) followed by a route ID, the request will stick to the origin server identified by that route ID. The default value is {{jsessionid}}. |
|{{route-hdr}} |(Optional) Name of the HTTP request header used to communicate route IDs to origin servers. {{set-origin-server}} associates each origin server named by a server parameter with a unique route ID. Origin servers may encode this route ID in the URI parameter named by the {{sticky-param}} parameter to cause subsequent requests to stick to them. The default value is {{Proxy-jroute}}. |
|{{route-cookie}} |(Optional) Name of the cookie generated by the server when it encounters a {{sticky-cookie}} in a response. The {{route-cookie}} parameter stores a route ID that enables the server to direct subsequent requests back to the same origin server. The default value is {{JROUTE}}. |
|{{rewrite-host}} |(Optional) Indicates whether the host HTTP request header is rewritten to match the host specified by the {{server}} parameter. The default value is {{false}} indicating that the host header is not rewritten. |
|{{rewrite-location}} |(Optional) Indicates whether the {{Location}} HTTP response header that matches the {{server}} parameter should be rewritten. The default value is {{true}}, indicating that the matching {{Location}} headers are rewritten. |
|{{rewrite-content-location}} |(Optional) Indicates whether the {{Content-Location}} HTTP response header that matches the server parameter should be rewritten. The default value is {{true}}, indicating that the matching {{Content-Location}} headers are rewritten. |
|{{rewrite-}}_headername_ |(Optional) Indicates whether the _headername_ HTTP response headers that match the server parameter should be rewritten, where _headername_ is a user-defined header name. _headername_ is in lowercase. With the exception of the {{Location}} and {{Content-Location}} headers, the default value is {{false}}, indicating that the {{headername}} header is not rewritten. |
|{{bucket}} |(Optional) Common to all {{obj.conf}} functions. Adds a bucket to monitor performance. For more information, see [The {{bucket}} Parameter|The bucket Parameter#b1]. |
h4. Example
{code}
Route fn="set-origin-server"
server="http://appserver1:8000"
server="http://appserver2:8000"
{code}
h4. See Also
* [{{map}}|NameTrans#name4]
* [{{set-proxy-server}}|Route#rout2]
h3. {{set-proxy-server}} {anchor:rout2}
The {{set-proxy-server}} function directs the server to retrieve the current resource from a particular proxy server.
h4. Parameters
The following table describes parameters for the {{set-proxy-server}} function.
Table 7-78 {{set-proxy-server}} Parameters
||Parameter ||Description ||
|{{server}} |URL of the remote proxy server. If multiple server parameters are given, the server distributes load among the specified remote servers. |
|{{bucket}} |(Optional) Common to all {{obj.conf}} functions. Adds a bucket to monitor performance. For more information, see [The {{bucket}} Parameter|The bucket Parameter#b1]. |
h4. Example
{code}
Route fn="set-proxy-server"
server="http://webcache1.eng.sun.com:8080"
server="http://webcache2.eng.sun.com:8080"
{code}
h4. See Also
[{{set-origin-server}}|Route#rout1]
h2. {{Route}} {anchor:rout}
The {{Route}} directive specifies information as to where the Web Server should route requests. For more information, see [{{Route}}|Flow of Control in obj.conf#route].
The following {{Route}}-class functions are described in detail in this section:
* [#{{set-origin-server}}]
* [#{{set-proxy-server}}]
In addition, the following common SAFs are valid for the Route directive:
* [{{match-browser}}|Common SAFs across Multiple Directives#saf2]
* [{{set-variable}}|Common SAFs across Multiple Directives#saf8]
h3. {{set-origin-server}} {anchor:rout1}
The {{set-origin-server}} function distributes the load across a set of homogeneous HTTP origin servers.
h4. Parameters
The following table describes parameters for the {{set-origin-server}} function.
Table 7-77 {{set-origin-server}} Parameters
||Parameter ||Description ||
|{{server}} |URL of the origin server. If multiple server parameters are given, the server distributes the load among the specified origin servers. |
|{{sticky-cookie}} |(Optional) Name of a cookie that, when present in a response, will cause subsequent requests to stick to that origin server. The default value is {{JSESSIONID}}. |
|{{sticky-param}} |(Optional) Name of a URI parameter to inspect for route information. When the URI parameter is present in a request URI and its value contains a colon ( : ) followed by a route ID, the request will stick to the origin server identified by that route ID. The default value is {{jsessionid}}. |
|{{route-hdr}} |(Optional) Name of the HTTP request header used to communicate route IDs to origin servers. {{set-origin-server}} associates each origin server named by a server parameter with a unique route ID. Origin servers may encode this route ID in the URI parameter named by the {{sticky-param}} parameter to cause subsequent requests to stick to them. The default value is {{Proxy-jroute}}. |
|{{route-cookie}} |(Optional) Name of the cookie generated by the server when it encounters a {{sticky-cookie}} in a response. The {{route-cookie}} parameter stores a route ID that enables the server to direct subsequent requests back to the same origin server. The default value is {{JROUTE}}. |
|{{rewrite-host}} |(Optional) Indicates whether the host HTTP request header is rewritten to match the host specified by the {{server}} parameter. The default value is {{false}} indicating that the host header is not rewritten. |
|{{rewrite-location}} |(Optional) Indicates whether the {{Location}} HTTP response header that matches the {{server}} parameter should be rewritten. The default value is {{true}}, indicating that the matching {{Location}} headers are rewritten. |
|{{rewrite-content-location}} |(Optional) Indicates whether the {{Content-Location}} HTTP response header that matches the server parameter should be rewritten. The default value is {{true}}, indicating that the matching {{Content-Location}} headers are rewritten. |
|{{rewrite-}}_headername_ |(Optional) Indicates whether the _headername_ HTTP response headers that match the server parameter should be rewritten, where _headername_ is a user-defined header name. _headername_ is in lowercase. With the exception of the {{Location}} and {{Content-Location}} headers, the default value is {{false}}, indicating that the {{headername}} header is not rewritten. |
|{{bucket}} |(Optional) Common to all {{obj.conf}} functions. Adds a bucket to monitor performance. For more information, see [The {{bucket}} Parameter|The bucket Parameter#b1]. |
h4. Example
{code}
Route fn="set-origin-server"
server="http://appserver1:8000"
server="http://appserver2:8000"
{code}
h4. See Also
* [{{map}}|NameTrans#name4]
* [{{set-proxy-server}}|Route#rout2]
h3. {{set-proxy-server}} {anchor:rout2}
The {{set-proxy-server}} function directs the server to retrieve the current resource from a particular proxy server.
h4. Parameters
The following table describes parameters for the {{set-proxy-server}} function.
Table 7-78 {{set-proxy-server}} Parameters
||Parameter ||Description ||
|{{server}} |URL of the remote proxy server. If multiple server parameters are given, the server distributes load among the specified remote servers. |
|{{bucket}} |(Optional) Common to all {{obj.conf}} functions. Adds a bucket to monitor performance. For more information, see [The {{bucket}} Parameter|The bucket Parameter#b1]. |
h4. Example
{code}
Route fn="set-proxy-server"
server="http://webcache1.eng.sun.com:8080"
server="http://webcache2.eng.sun.com:8080"
{code}
h4. See Also
[{{set-origin-server}}|Route#rout1]