Prev: Next: , Up: Response Modification[Contents][Index]


9.9.6.1 The 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_directivesmodification_directives…
[ Else
    conditional_directivesmodification_directives… ]
  End

The conditional directives allowed for use in this statement are:

Rewrite response conditional: Header [options] "pattern"

Returns ‘true’, if the response contains at least one header matching the given pattern.

Rewrite response conditional: StringMatch "string" [options] "pattern"

Expands string as described in String Expansions, and matches the resulting value against pattern.

Both conditionals treat their pattern argument as case-insensitive POSIX extended regular expression. See Table 9.2, for a discussion of available options.

The following response modification directives are defined:

Response modification: DeleteHeader [options] "pattern"

Remove matching headers from the response. By default, pattern is treated as extended POSIX regular expression. Use options to alter this behavior. See Table 9.1, for a list of available options.

Response modification: SetHeader "name: value"

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.