Skip to main content
Version: 4.6.x.x LTS

Conditions

You can use conditions to enable configuration attributes dynamically depending on various input sources like request headers, environment variables, query parameters and more. Only one condition per line is accepted.

You can add multiple conditions before a configuration attribute. The following applies:

  • As soon as one of the conditions matches, the following conditions are no longer considered.
  • If one condition does not match, the subsequent attribute is skipped. In case of a pragma block Pragma: block-begin/Pragma: block-end, all attributes within the block are skipped.

For more information on pragmas, see Pragmas.

  • A preceding "!" will negate the condition.
  • If there are no conditions defined at all, the attribute is enabled automatically.

Syntax:

[!]Condition:<SOURCE>:<VARIABLE>:<expression>
SOURCE: HEADER, PARAM, AUTH, ENV
HEADER: Source of request headers
PARAM: Source of parameters in query or POST body (see also ParameterFilter)
AUTH: Source of nevisAuth and session attributes
ENV: Source of apache enviroment variables
VARIABLE: The name of wished parameter depending of the preceding source
<expression>: a regular expression

The ENV source also contains variables that are generated internally by nevisProxy itself, such as the variables generated by the connector servlet processing a request. For example, use ENV:bcx.servlet.response.<header name> to access HTTP response headers.

See Regular expressions for more information about the <expression> value.

Usage example:

Condition:REMOTE_ADDR:CIDR/10.4.12.0/24/
NameOfYourWishedParameter
!Condition:HEADER:User-Agent:mozilla.*
Condition:AUTH:isiwebuser:.*
NameOfAnotherParameter
NameOfYourDefaultParameter

If the remote client address is in the specified address range, the NameOfYourWishedParameter is taken. Depending on the pragma, the condition breaks here or returns the next parameter".