Prev: Next: Up: ListenHTTP[Contents][Index]


9.9.5 Request Modification

The statements discussed in this subsection modify incoming requests prior to passing them to the backend. These same set of statements can also be used in Service section (see Service). When appearing in both sections, the directive from ListenHTTP (ListenHTTPS) section are applied first, followed by directives from the Service section. Directives from the same section are applied in order of their appearance.

ListenerHTTP directive: RewriteDestination bool

If set to ‘true’, the Destination: request header will be changed to point to the backend with the correct protocol.

ListenerHTTP directive: SetURL "url"

Set the URL of the incoming request to url.

ListenerHTTP directive: SetPath "value"

Set the path part of the URL to the given string.

ListenerHTTP directive: SetQuery "value"

Set the query part of the URL to the given string. Value must be a valid query with the special characters properly encoded using percent encoding.

ListenerHTTP directive: SetQueryParam "name" "value"

Set the query parameter name to the value. Value must be properly encoded if it contains reserved characters.

ListenerHTTP directive: SetHeader "name: value"
ListenerHTTP directive: HeaderAdd "name: value"
ListenerHTTP directive: AddHeader "name: value"

Sets the HTTP header. If the header name already exists, it will be overwritten. Otherwise, new header will be added to the end of the header list.

The HeaderAdd and AddHeader forms are retained for backward compatibility with earlier pound versions. You are advised against using them.

ListenerHTTP directive: DeleteHeader [options] "pattern"

Remove from the request all headers matching pattern. The HeaderRemove and HeadRemove forms are retained for backward compatibility with earlier pound versions. You are advised against using them.

By default, pattern is treated as extended POSIX regular expression. The options argument can be used to alter this. It consists of zero or more option flags from the following list:

FlagMeaning
-begExact match at the beginning of string (prefix match).
-caseCase-sensitive comparison.
-containDelete each header where "pattern" is a substring.
-endExact match at the end of string (suffix match).
-exactUse exact string match.
-icaseCase-insensitive comparison.
-pcreUse Perl-compatible regular expression. see Regular Expressions.
-perlSame as -pcre.
-posixUse POSIX extended regular expression. see Regular Expressions.
-reUse regular expression match. This assumes the default regular expression type, as set by the RegexType directive (see Regular Expressions).

Table 9.1: Header matching flags for DeleteHeader directive

The following options are mutually exclusive: -beg, -contain, -end, -exact, -pcre (-perl), -posix, -re. If more than one of these are used, the last one takes effect.

ListenerHTTP directive: HeaderRemove "pattern"
ListenerHTTP directive: HeadRemove "pattern"

These are obsolete keywords, equivalent to

DeleteHeader -icase "pattern"

Prev: Next: Up: ListenHTTP[Contents][Index]