The proxy-config.xml file
The AJAX Proxy configuration is specified by using an XML file called named proxy-config.xml. The latest version of the XML schema of this file consists of the following main elements. They must all be children elements of the proxy rules root element. For more details about the XML schema refer to the end of the section about the AJAX proxy.
Here is an example...
./config/cells/cell1/applications/AJAX Proxy Configuration.ear/deployments/AJAX Proxy Configuration/wp.proxy.config.war/WEB-INF/proxy-config.xml
<?xml version="1.0" encoding="UTF-8"?> <proxy-rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:proxy="http://www.ibm.com/xmlns/prod/sw/ajax/proxy-config/1.0"> <proxy:mapping contextpath="/proxy" url="*"/> <proxy:mapping contextpath="/myproxy" url="*"/> <proxy:mapping contextpath="/common_proxy" url="*"/> <proxy:policy url="http://www.ibm.com/*" acf="none"> <proxy:actions> <proxy:method>GET</proxy:method> </proxy:actions> </proxy:policy> <proxy:policy url="http://www-03.ibm.com/*" acf="none"> <proxy:actions> <proxy:method>GET</proxy:method> </proxy:actions> </proxy:policy> <proxy:policy url="http://www.redbooks.ibm.com/*" acf="none"> <proxy:actions> <proxy:method>GET</proxy:method> </proxy:actions> </proxy:policy> <proxy:policy url="{$default_ltpa_policy}" acf="none"> <proxy:actions> <proxy:method>GET</proxy:method> <proxy:method>HEAD</proxy:method> </proxy:actions> <proxy:cookies> <proxy:cookie>LtpaToken</proxy:cookie> <proxy:cookie>LtpaToken2</proxy:cookie> </proxy:cookies> </proxy:policy> <proxy:policy url="{$default_policy}" acf="none"> <proxy:actions> <proxy:method>GET</proxy:method> <proxy:method>HEAD</proxy:method> </proxy:actions> </proxy:policy> <proxy:policy url="{$federated_documents_policy}" acf="none" basic-auth-support="true"> <proxy:actions> <proxy:method>GET</proxy:method> <proxy:method>HEAD</proxy:method> <proxy:method>POST</proxy:method> <proxy:method>DELETE</proxy:method> <proxy:method>PUT</proxy:method> </proxy:actions> <proxy:cookies> <proxy:cookie>LtpaToken</proxy:cookie> <proxy:cookie>LtpaToken2</proxy:cookie> </proxy:cookies> <proxy:headers> <proxy:header>User-Agent</proxy:header> <proxy:header>Accept*</proxy:header> <proxy:header>Content*</proxy:header> <proxy:header>Authorization*</proxy:header> <proxy:header>X-Method-Override</proxy:header> <proxy:header>Set-Cookie</proxy:header> <proxy:header>If-Modified-Since</proxy:header> <proxy:header>If-None-Match</proxy:header> <proxy:header>X-Server</proxy:header> <proxy:header>X-Update-Nonce</proxy:header> <proxy:header>X-Requested-With</proxy:header> <proxy:header>com.ibm.lotus.openajax.virtualhost</proxy:header> <proxy:header>com.ibm.lotus.openajax.virtualport</proxy:header> </proxy:headers> <proxy:meta-data> <proxy:name>xhr-authentication-support</proxy:name> <proxy:value>true</proxy:value> </proxy:meta-data> </proxy:policy> <proxy:meta-data> <proxy:name>socket-timeout</proxy:name> <proxy:value>10000</proxy:value> </proxy:meta-data> <proxy:meta-data> <proxy:name>retries</proxy:name> <proxy:value>2</proxy:value> </proxy:meta-data> <proxy:meta-data> <proxy:name>max-connections-per-host</proxy:name> <proxy:value>5</proxy:value> </proxy:meta-data> <proxy:meta-data> <proxy:name>max-total-connections</proxy:name> <proxy:value>100</proxy:value> </proxy:meta-data> </proxy-rules>
- policy
- The policy element is the most important element in the proxy configuration. Use the policy element to define an access policy for a specific URL pattern. A proxy configuration can contain multiple policy definitions. If no policy is specified at all, all incoming requests are denied. For more details about policies, refer to the section about access policies among the links below.
- mapping
- Use the mapping element to map incoming requests to a target URL, based on their context path. Therefore each mapping element needs to specify a contextpath attribute and optionally a url attribute. Mapping elements can optionally declare policy elements that represent mapping specific access policies. For more details about how to use mapping elements refer to the subsection about context path mappings.
- ipfilter
- Use ipfilter elements to define one or several IP filtering rules. You can use IP filtering rules to either grant or deny access to a particular IP address or to a set of addresses. For more details about IP filtering rules, refer to the subsection about IP filtering.
- meta-data
- Use the meta-data to specify general configuration properties of the proxy, for example. HTTP-related parameters. Each meta-data element must have a name subelement and a value subelement.
To get a list of configuration parameters that are available in the portal, refer to the section about general configuration parameters.
- Access policies
Each policy element defines an access policy for a given URL pattern. The pattern is specified by means of the url attribute.
- Context path mappings
Use a context path mapping to map a particular context path to a particular target URL. The proxy resolves context path mappings prior to applying the matching access policy.
- IP filtering
You can use ipfilter elements to declare IP filtering rules and to either grant or deny access to a particular IP address or to a set of addresses.
- General configuration parameters
You can add general proxy configuration parameters to the file proxy-config.xml by using meta-data elements.
- Examples of AJAX proxy configurations
The following two examples show sample proxy-config.xml files that you can use as templates to define your own configurations. You can use these samples as a base to write your own AJAX proxy configuration
Parent topic:
AJAX proxy configuration