The ObjectType directives determine the MIME type of the file that has to be sent to the client in response to a request. For more information, see ObjectType.
The following ObjectType-class functions are described in detail in this section:
In addition, the following common SAFs are valid for the ObjectType directive:
The block-auth-cert function instructs the server not to forward the client’s SSL/TLS certificate to remote servers.
The following table describes parameter for the block-auth-cert function.
Table 7–33 block-auth-cert Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-auth-cert"
The block-cache-info function instructs the server not to forward information about local cache hits to remote servers.
The following table describes parameter for the block-cache-info function.
Table 7–34 block-cache-info Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-cache-info"
The block-cipher function instructs the server to forward the name of the client’s SSL/TLS cipher suite to remote servers.
The following table describes parameter for the block-cipher function.
Table 7–35 block-cipher Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-cipher"
The block-ip function instructs the server not to forward the client’s IP address to remote servers.
The following table describes parameter for the block-ip function.
Table 7–36 block-ip Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-ip"
The block-issuer-dn function instructs the server not to forward the distinguished name of the issuer of the client’s SSL/TLS certificate to remote servers.
The following table describes parameter for the block-issuer-dn function.
Table 7–37 block-issuer-dn Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-auth-cert"
The block-jroute function instructs the server not to forward information about request routing to remote servers using the proprietary Proxy-jroute format.
The following table describes parameter for the block-jroute function.
Table 7–38 block-jroute Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-jroute"
The block-keysize function instructs the server not to forward the size of the client’s SSL/TLS key to remote servers.
The following table describes parameter for the block-keysize function.
Table 7–39 block-keysize Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-keysize"
The block-proxy-agent function instructs the server not to forward its version information to remote servers.
The following table describes parameter for the block-proxy-agent function.
Table 7–40 block-proxy-agent Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-proxy-agent"
The block-proxy-auth function instructs the server not to forward the client’s proxy authentication credentials, that is, the client’s Proxy-authorization HTTP request header, to remote servers.
The following table describes parameter for the block-proxy-auth function.
Table 7–41 block-proxy-auth Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-proxy-auth"
The block-secret-keysize function instructs the server not to forward the size of the client’s SSL/TLS secret key to remote servers.
The following table describes parameter for the block-secret-keysize function.
Table 7–42 block-secret-keysize Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-secret-keysize"
The block-ssl-id function instructs the server not to forward the client’s SSL/TLS session ID to remote servers.
The following table describes parameter for the block-ssl-id function.
Table 7–43 block-ssl-id Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-ssl-id"
The block-user-dn function instructs the server not to forward the distinguished name of the subject of the client’s SSL/TLS certificate to remote servers.
The following table describes parameter for the block-user-dn function.
Table 7–44 block-user-dn Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-user-dn"
The block-via function instructs the server not to forward information about request routing to remote servers using the HTTP/1.1 Via format.
The following table describes parameter for the block-via function.
Table 7–45 block-via Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="block-via"
The force-type function assigns a type to requests that do not already have a MIME type. This function is used to specify a default object type.
Ensure that the directive that calls this function comes last in the list of ObjectType directives, so that all other ObjectType directives have a chance to set the MIME type. If a directive sets an attribute and later directives try to set that attribute to something else, the first setting is used and the subsequent settings are ignored.
The following table describes parameters for the force-type function.
Table 7–46 force-type Parameters
Parameter |
Description |
---|---|
(Optional) Type assigned to a matching request (the Content-Type header). |
|
(Optional) Encoding assigned to a matching request (the Content-Encoding header). |
|
(Optional) Language assigned to a matching request (the Content-Language header). |
|
(Optional) Character set for the magnus-charset parameter in rq->srvhdrs. If a browser sends the Accept-Charset header or its User-Agent is Mozilla/1.1 or newer, then append “; charset=charset” to Content-Type, where charset is the value of the magnus-charset parameter in rq->srvhdrs. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="force-type" type="text/plain" ObjectType fn="force-type" lang="en_US"
The forward-auth-cert function instructs the server to forward the client’s SSL/TLS certificate to remote servers.
The following table describes parameters for the forward-auth-cert function.
Table 7–47 forward-auth-cert Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the client’s DER-encoded SSL/TLS certificate in Base 64 encoding. The default value is Proxy-auth-cert. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-cache-info function instructs the server to forward information about local cache hits to remote servers.
The following table describes parameters for the forward-cache-info function.
Table 7–48 forward-cache-info Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate information about local cache hits. The default value is Cache-info. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-cipher function instructs the server to forward the name of the client’s SSL/TLS cipher suite to remote servers.
The following table describes parameters for the forward-cipher function.
Table 7–49 forward-cipher Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the name of the client’s SSL/TLS cipher suite. The default value is Proxy-cipher. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-ip function instructs the server to forward the client’s IP address to remote servers.
The following table describes parameters for the forward-ip function.
Table 7–50 forward-ip Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the client’s IP address. The default value is Client-ip. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-issuer-dn function instructs the server to forward the distinguished name of the issuer of the client’s SSL/TLS certificate to remote servers.
The following table describes parameters for the forward-issuer-dn function.
Table 7–51 forward-issuer-dn Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the distinguished name of the issuer of the client’s SSL/TLS certificate. The default value is Proxy-issuer-dn. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-jroute function instructs the server to forward information about request routing using the proprietary Proxy-jroute format. The Proxy-jroute header field is used by the set-origin-server function and some Servlet containers to implement session stickiness.
The following table describes parameters for the forward-jroute function.
Table 7–52 forward-jroute Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the request routing information. The default value is Proxy-jrout. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-keysize function instructs the server to forward the size of the client’s SSL/TLS key to remote servers.
The following table describes parameters for the forward-keysize function.
Table 7–53 forward-keysize Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the size of the client’s SSL/TLS key. The default value is Proxy-keysize. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-proxy-agent function instructs the server to forward its version information to remote servers.
The following table describes parameters for the forward-proxy-agent function.
Table 7–54 forward-proxy-agent Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate server version. The default value is Proxy-agent. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-proxy-auth instructs the server to forward the client’s proxy authentication credentials, that is, the client’s Proxy-authorization HTTP request header to remote servers.
The following table describes parameter for the forward-proxy-auth function.
Table 7–55 forward-proxy-auth Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="forward-proxy-auth"
The forward-secret-keysize function instructs the server to forward the size of the client’s SSL/TLS secret key to remote servers.
The following table describes parameters for the forward-secret-keysize function.
Table 7–56 forward-secret-keysize Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the size of the client’s SSL/TLS secret key. The default value is Proxy-secret-keysize. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-ssl-id function instructs the server to forward the client’s SSL/TLS session ID to remote servers.
The following table describes parameters for the forward-ssl-id function.
Table 7–57 forward-ssl-id Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the client’s SSL/TLS session ID. The default value is Proxy-ssl-id. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-user-dn function instructs the server to forward the distinguished name of the subject of the client’s SSL/TLS certificate to remote servers.
The following table describes parameters for the forward-user-dn function.
Table 7–58 forward-user-dn Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate the distinguished name of the subject of the client’s SSL/TLS certificate. The default value is Proxy-user-dn. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The forward-via function instructs the server to forward information about request routing to remote servers using the HTTP/1.1 Via format. The HTTP/1.1 Via header field records the proxy servers and protocol versions that were involved in routing a request.
The following table describes parameters for the forward-via function.
Table 7–59 forward-via Parameters
Parameter |
Description |
---|---|
hdr |
(Optional) Name of the HTTP request header used to communicate routing information. The default value is Via. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The http-client-config function configures the server’s HTTP client.
The following table describes parameters for the http-client-config function.
Table 7–60 http-client-config Parameters
Parameter |
Description |
---|---|
(Optional) Indicates whether the HTTP client should attempt to use persistent connections. The default value is true. |
|
(Optional) The maximum number of seconds to keep a persistent connection open. The default value is 29. |
|
(Optional) Indicates whether the HTTP client can reuse existing persistent connections for all types of requests. The default value is false indicating that persistent connections will not be reused for non-GET requests or for requests with a body. |
|
(Optional) HTTP protocol version string. By default, the HTTP client uses either HTTP/1.0 or HTTP/1.1 based on the contents of the HTTP request. In general, you should not use the protocol parameter unless you encounter specific protocol interoperability problems. |
|
(Optional) Value of the proxy-agent HTTP request header. The default is a string that contains the web server product name and version. |
|
(Optional) The number of times to retry getting content from the origin web server before sending an error to the client. Acceptable values are 0 through 100, with the value 0 indicating that no retries should be attempted. The default value is 3. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="http-client-config" keep-alive="false"
The set-basic-auth function sets the HTTP basic authentication credentials used by the server when it sends an HTTP request. Use set-basic-auth to authenticate to a remote origin server or proxy server.
The following table describes parameters for the set-basic-auth function.
Table 7–61 set-basic-auth Parameters
Parameter |
Description |
---|---|
user |
Name of the user to authenticate. |
password |
Password of the user to authenticate. |
hdr |
(Optional) Name of the HTTP request header used to communicate the credentials. |
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="set-basic-auth" user="admin" password="secret" hdr="proxy-authorization"
The set-cache-control function allows you to specify the HTTP caching policy for the response being sent back to the client.
The following table describes parameters for the set-cache-control function.
Table 7–62 set-cache-control Parameters
Parameter |
Description |
---|---|
HTTP cache control directives. Separate multiple directives by commas. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
The following table describes some of the useful cache control directives defined by the HTTP/1.1 protocol.
Table 7–63 Cache Control Directives
Directive |
Description |
---|---|
public |
The response may be cached by any cache. |
private |
The response must not be cached by a shared cache (for example, a proxy server). |
no-cache |
Clients must ask the server for updated content on each access. |
max-age=n |
The response should not be cached for more than n seconds. |
ObjectType fn="set-cache-control" control="private,max-age=60"
The set-cookie function allows you to set a cookie in the response being sent back to the client.
The following table describes parameters for the set-cookie function.
Table 7–64 set-cookie Parameters
Parameter |
Description |
---|---|
name |
Name of the cookie. |
value |
(Optional) Value of the cookie. The default value is null. |
path |
(Optional) Base URI to which the cookie applies. The default value is / (slash). |
(Optional) The domain name of servers to which the cookie must be sent. If no domain is specified, web browsers send the cookie only to the server that sets the cookie. |
|
(Optional) Maximum time (in seconds) after which the cookie expires. If max-age is not specified, web browsers delete the cookie when the user closes the web browser. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
<If not defined $cookie{'FIRSTVISITTIME'}> ObjectType fn="set-cookie" name="FIRSTVISITTIME" value="$time" max-age="31536000" </If>
The set-default-type function allows you to define a default charset, content-encoding, and content-language for the response being sent back to the client.
If the charset, content-encoding, and content-language are not set for a response, then just before the headers are sent the defaults defined by set-default-type are used. By placing this function in different objects in obj.conf, you can define different defaults for different parts of the document tree.
The following table describes parameters for the set-default-type function.
Table 7–65 set-default-type Parameters
Parameter |
Description |
---|---|
(Optional) Encoding assigned to a matching request (the Content-Encoding header). |
|
(Optional) Language assigned to a matching request (the Content-Language header). |
|
(Optional) Character set for the magnus-charset parameter in rq->srvhdrs. If a browser sends the Accept-Charset header or its User-Agent is Mozilla/1.1 or newer, then append “; charset=charset” to Content-Type, where charset is the value of the magnus-charset parameter in rq->srvhdrs. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="set-default-type" charset="iso_8859-1"
The shtml-hacktype function changes the Content-Type of any .htm or .html file to magnus-internal/parsed-html and returns REQ_PROCEED. This provides backward compatibility with server-side includes for files with .htm or .html extensions. The function may also check the execute bit for the file on UNIX systems. The use of this function is not recommended.
The following table describes parameters for the shtml-hacktype function.
Table 7–66 shtml-hacktype Parameters
Parameter |
Description |
---|---|
(Optional, UNIX only) Instructs the function to change the Content-Type only if the execute bit is enabled. The value of the parameter is not important, but the parameter should be provided. The value can be true. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="shtml-hacktyp"e exec-hack="true"
The ssl-client-config function configures options used when the server connects to a remote server using SSL/TLS.
The following table describes parameters for the ssl-client-config function.
Table 7–67 ssl-client-config Parameters
Parameter |
Description |
---|---|
(Optional) Nickname of the client certificate to present to the remote server. The default is not to present a client certificate. |
|
(Optional) Boolean that indicates whether the server validates the certificate presented by the remote server. The default value is true, indicating that remote servers must present valid certificates that were issued by a trusted certificate authority. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="ssl-client-config" validate-server-cert="false"
The type-by-exp function matches the current path with a wildcard expression. If they match, the type parameter information is applied to the file. This is the same as type-by-extension, except that you use wildcard patterns for the files or directories specified in the URLs.
The following table describes parameters for the type-by-exp function.
Table 7–68 type-by-exp Parameters
Parameter |
Description |
---|---|
Wildcard pattern of paths for which this function is applied. |
|
(Optional) Type assigned to a matching request (the Content-Type header). |
|
(Optional) Encoding assigned to a matching request (the Content-Encoding header). |
|
(Optional) Language assigned to a matching request (the Content-Language header). |
|
(Optional) The character set for the magnus-charset parameter in rq->srvhdrs. If a browser sends the Accept-Charset header or its User-Agent is Mozilla/1.1 or newer, then append “; charset=charset” to Content-Type, where charset is the value of the magnus-charset parameter in rq->srvhdrs. |
|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="type-by-exp" exp="*.test" type="application/html"
The type-by-extension function instructs the server to look in a table of MIME type mappings to find the MIME type of the requested resource. The MIME type is added to the Content-Type header that is sent back to the client.
The table of MIME type mappings is created by a mime-file element in the server.xml file, which loads a MIME types file or list and creates the mappings.
For example, the following two lines are part of a MIME types file:
type=text/html exts=htm,html type=text/plain exts=txt
If the extension of the requested resource is htm or html, the type-by-extension file sets the type to text/html. If the extension is .txt, the function sets the type to text/plain.
The following table describes parameters for the type-by-extension function.
Table 7–69 type-by-extension Parameters
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="type-by-extension"
The type-j2ee function sets the Content-Type for requests that map to resources in a Java web application. When configuring the server to host Servlet or JSP-based web applications, type-j2ee must be the first ObjectType SAF in obj.conf. This is to ensure that web.xml MIME type mappings take precedence over the default MIME type mappings.
The following table describes parameter for the type-j2ee function.
Table 7–70 type-j2ee Parameter
Parameter |
Description |
---|---|
bucket |
(Optional) Common to all obj.conf functions. Adds a bucket to monitor performance. For more information, see The bucket Parameter. |
ObjectType fn="type-j2ee"