Rewrite response statement.A special form of the Rewrite statement is provided for
modifying headers in the response obtained from a regular backend or
generated with a Error backend, before sending them back to
the requesting server:
Rewrite response
conditional_directives…
modification_directives…
[ Else
conditional_directives…
modification_directives… ]
End
The conditional directives allowed for use in this statement are:
Evaluates the detached condition name. The result
is cached, so that each detached condition is evaluated at most once.
All Eval directives referring to its name will reuse the cached
value. See Detached Conditions, for a detailed discussion.
Returns ‘true’, if the response contains at least one header matching the given pattern.
Run Lua function func with the supplied arguments. Use its return value (which must be boolean) as the result of the test.
The func can be either an unqualified function name, or function
name with module qualifier (module.func).
Each arg is subject to to backreference expansion and request accessor interpretation, as discussed in Request modifications.
This statement is available only if pound was built with Lua
support. See Lua conditionals, for a detailed discussion.
Expands string as described in String Expansions, and matches the resulting value against pattern.
See conditional-option, for a detailed discussion of options and their effect on matching.
Both conditionals treat their pattern argument as case-insensitive POSIX extended regular expression. See conditional-option, for a discussion of available options.
The following response modification directives are defined:
Remove matching headers from the response. By default, pattern is treated as extended POSIX regular expression. Use options to alter this behavior. See Table 10.1, for a list of available options.
Run Lua function func with supplied arguments. The function is supposed to modify the response.
The func can be either an unqualified function name, or function
name with module qualifier (module.func).
Each arg is subject to to backreference expansion and request accessor interpretation, as discussed in Request modifications.
This statement is available only if pound was built with Lua
support. See Changing requests and responses in Lua, for a detailed discussion.
Sets the HTTP response header. Argument undergoes string expansion (See String Expansions). If the header name already exists, it will be overwritten. Otherwise, new header will be added to the end of the header list.