assign-name
Applicable in NameTrans-class directives.
The assign-name function specifies the name of an
object in obj.conf that matches the current request. The
server then processes the directives in the named object in preference to
the ones in the default object.
For example, consider the following directive in the default object:
NameTrans fn=assign-name name=personnel from=/personnel
Suppose the server receives a request for http://server-name/personnel. After processing this NameTrans directive, the server looks for an object named personnel in obj.conf, and continues by processing the
directives in the personnel object.
The assign-name function always returns REQ_NOACTION.
Parameters
The following table describes the parameters for the assign-name function.
Table 5–41
assign-name parameters
Parameter
|
Description
|
from
|
Wildcard pattern that specifies the path to be affected.
|
name
|
Specifies an additional named object in obj.conf whose
directives are applied to this request.
|
find-pathinfo-forward
|
(Optional) Makes the server look for the PATHINFO forward
in the path after the ntrans-base instead of backward from the end of path as the server
function assign-name does by default.
The value you assign to this parameter is ignored. If you do not want
to use this parameter, do not include it.
The find-pathinfo-forward parameter is ignored if
the ntrans-base parameter is not set in rq->vars.
By default, ntrans-base is set.
This feature can improve performance for certain URLs by reducing the
number of stats performed.
|
nostat
|
(Optional) Prevents the server from performing a stat on a specified
URL whenever possible.
The effect of nostat="virtual-path" in the NameTrans function assign-name is
that the server assumes that a stat on the specified virtual-path will
fail. Therefore, use nostat only when the path of the virtual-path does not exist on the system, for example, for
NSAPI plug-in URLs, to improve performance by avoiding unnecessary stats on
those URLs.
When the default PathCheck server functions are used,
the server does not stat for the paths /ntrans-base/virtual-path and /ntrans-base/virtual-path/* if ntrans-base is set (the default condition); it does not stat
for the URLs /virtual-path and /virtual-path/* if ntrans-base is not set.
|
bucket
|
(Optional) Common to all obj.conf functions.
|
Example
# This NameTrans directive is in the default object.
NameTrans fn=assign-name name=personnel from=/a/b/c/pers...
<Object name=personnel>...additional directives..</Object>
NameTrans fn="assign-name" from="/perf" find-pathinfo-forward="" name="perf"
NameTrans fn="assign-name" from="/nsfc" nostat="/nsfc" name="nsfc"
|