Oracle iPlanet Web Proxy Server 4.0.14 Configuration File Reference

Output

All Output directives are executed when the server or a plug-in first attempts to write entity body data from the client.

The Output stage enables you to select filters that will process outgoing data.

You can add NSAPI filters that process outcoming data by invoking the insert-filter SAF in the Output stage of the request-handling process. The Output directives are executed at most once per request.

You can define the appropriate position of a specific filter within the filter stack. For example, filters that translate content from XML to HTML are placed higher in the filter stack than filters that compress data for transmission. You can use the filter_create function to define the filter’s position in the filter stack, and the init-filter-order to override the defined position.

When two or more filters are defined to occupy the same position in the filter stack, filters that were inserted later will appear higher than filters that were inserted earlier.

The following Output-class functions are described in detail in this section:

content-rewrite

The content-rewrite function rewrites the string in the document that is being sent to the client.

When a document is sent by the proxy server, the content-rewrite function is invoked if it has been configured and would replace the from string/url to destination string/url before sending the response to the client.

The patterns are strings that would be replaced in the outgoing document. The pattern can be either a URL with absolute or relative links, or any text string such as the server name and the like.

Syntax

Output fn="insert-filter" filter="content-rewrite" type="text/html" 
	from="<sourcepattern>" to="<destpattern>"

Parameters

The following table describes the parameter for the content-rewrite function.

Table 5–97 content-rewrite Parameters

Parameter  

Description  

filter

Specifies the name of the filter to be executed. 

type

Indicates the content-type on which this filter is applied, for example, text, html, and so on. 

Example


Output fn="insert-filter" type="text/*" filter="content-rewrite" 
	from="iPlanet"  to="Sun ONE (now called) Sun Java System Web Server"

insert-filter

Applicable in Output-class directives.

The insert-filter SAF is used to add the content rewriting engine to the filter stack to process outgoing server-to-client data.

This directive should appear in the http://.* and https://.* objects inside of the obj.conf file.

The insert-filter SAF will result in rewriting if the request had been associated with a filter by um-ntrans (See um-ntrans).

The order of Input fn="insert-filter" and Output fn="insert-filter" directives can be important.

Returns

Returns REQ_PROCEED if the specified filter was inserted successfully, or REQ_NOACTION if the specified filter was not inserted because it was not required. Any other return value indicates an error.

Parameters

The following table describes the parameter for the insert-filter function.

Table 5–98 insert-filter parameters

Parameter  

Description  

filter

Specifies the name of the filter to insert. Must be set to "um-output".

bucket

(Optional) Common to all obj.conf functions.

type

Specifies the MIME types to which the filter will be applied. It can be omitted, as the filter makes its own choices about what types of content to filter. If it is provided, it should be set to "*".

Example


Output fn="insert-filter" filter="um-output"

match-browser

See match-browser.

remove-filter

Applicable in Input-, Output-, Service-, and Error-class directives.

The remove-filter SAF is used to remove a filter from the filter stack. If the filter has been inserted multiple times, only the topmost instance is removed. You do not have to remove filters with remove-filter, as they will be removed automatically at the end of the request.

Returns

Returns REQ_PROCEED if the specified filter was removed successfully, or REQ_NOACTION if the specified filter was not part of the filter stack. Any other return value indicates an error.

Parameters

The following table describes the parameter for the remove-filter function.

Table 5–99 remove-filter Parameters

Parameter  

Description  

filter

Specifies the name of the filter to remove. 

bucket

(Optional) Common to all obj.conf functions.

Example


Output fn="remove-filter" filter="http-compression"

sed-response

The sed-response filter applies sed edit commands to an outgoing response entity body, for example, an HTML file or output from a Servlet.

Parameter

The following table describes parameter for the sed-response filter

Table 5–100 sed-response Parameter

Parameter 

Description 

sed

Specifies a sed command script. When multiple sed parameters are provided, the sed edit commands are evaluated in the order they appear.

Example

The following obj.conf code instructs sed-response to rewrite any occurrence of http://127.0.0.1/ in an HTML response to http://server.example.com/:

Output fn="insert-filter"
       type="text/html"
       filter="sed-response"
       sed="s|http://127.0.0.1/|http://server.example.com/|g"

See Also

set-variable

Applicable in all stage directives. The set-variable SAF enables you to change server settings based upon conditional information in a request, and to manipulate variables in parameter blocks by using specific commands. See set-variable.