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:
Returns ‘true’, if the response contains at least one header matching the given 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:
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.
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.